<?php
/**
 * @Copyright Copyright (C) 2010- ... Webit Solution
 * @license GNU/GPL http://www.gnu.org/copyleft/gpl.html
 * Company:		Webit Solution
 + Contact:		www.webits.asia, info@webits.asia
 * Created on:	Mar 21, 2012
 ^
 + Project: 		WRecruit
 * File Name:	install.wrecruit.php
 ^ 
 * Description: Installer
 ^ 
 * History:		NONE
 ^ 
 */

defined ('_JEXEC') or die ('Restricted access');
 
function com_install()
{
	echo '<pre>';

	$version = getVersion(); 
	checkBackup(); 
	installModulePlugin($version);
	echo '</pre>';
	echo '<p>Thank you for installing WRecruit\'s WRecruit Joomla Job Board Component.</p>';
	
	return true;
}

function getVersion(){
	$db = &JFactory::getDBO();

	$return_value;	
	$query = 'SELECT COUNT(*) FROM '.$db->nameQuote('#__wrecruit_config_bak');
	$db->setQuery($query);
	$backup = $db->loadResult();
	if ( $backup == 0 )	{ // no back up found
			return 0;
	}else { // backup found
			$query = 'SELECT * FROM '.$db->nameQuote('#__wrecruit_config_bak')." WHERE configname = 'versioncode'";
			$db->setQuery($query);
			$version = $db->loadObject();
			if($version){
				return $version->configvalue;
			}else return 0;

	}	
	return 0;
}

function checkBackup(){
	$db = &JFactory::getDBO();

	$com_query = "UPDATE #__components SET admin_menu_img = '' WHERE admin_menu_link='option=com_wrecruit'";
	$db->setQuery($com_query);
	$db->query();
	
	$return_value;	
	$query = 'SELECT COUNT(*) FROM '.$db->nameQuote('#__wrecruit_config_bak');
	$db->setQuery($query);
	$backup = $db->loadResult();
        if ( $backup == 0 )	{ // no back up found
				insertDefaultValues();                                                // insert default values
        }else { // backup found
                $query = 'SELECT * FROM '.$db->nameQuote('#__wrecruit_config_bak')." WHERE configname = 'versioncode'";
				$db->setQuery($query);
                $version = $db->loadObject();
                if($version){
                    if(($version->configvalue == '107') || ($version->configvalue == '1071') || ($version->configvalue == '1072') || ($version->configvalue == '1073') || ($version->configvalue == '1074') || ($version->configvalue == '1075') || ($version->configvalue == '1076') || ($version->configvalue == '1077'))
                        bacupv107($version->configvalue);
                    elseif(($version->configvalue == '106') || ($version->configvalue == '1061')|| ($version->configvalue == '1062'))
                        bacupv106($version->configvalue);
                    elseif(($version->configvalue == '105') || ($version->configvalue == '1051') || ($version->configvalue == '1052') || ($version->configvalue == '1053') || ($version->configvalue == '1054')
                         || ($version->configvalue == '1055') || ($version->configvalue == '1056') || ($version->configvalue == '1057') || ($version->configvalue == '10571') || ($version->configvalue == '1058')
                         || ($version->configvalue == '1502') || ($version->configvalue == '1503') || ($version->configvalue == '1504') || ($version->configvalue == '1505') || ($version->configvalue == '1506')
                         || ($version->configvalue == '15061') || ($version->configvalue == '1507') || ($version->configvalue == '15071') || ($version->configvalue == '1508')
						 )
                        bacupv105();
                    else{
		                $query = 'SELECT COUNT(*) FROM '.$db->nameQuote('#__wrecruit_userroles_bak');
		                $db->setQuery($query);
		                //echo '<br>SQL '.$query;
		                $isv105 = $db->loadResult();
		                if ( $isv105 == 1 )	{ // v1.0.5
							bacupv105();
		                }else
							echo "<font color='red'>".JText::_('Error! can not upgrade this version.</font><br>');
                    }
                }

		}	
	return true;
}

function full_copy( $source, $target ) {
	if ( is_dir( $source ) ) {
		@mkdir( $target );
		$d = dir( $source );
		while ( FALSE !== ( $entry = $d->read() ) ) {
			if ( $entry == '.' || $entry == '..' ) {
				continue;
			}
			$Entry = $source . '/' . $entry; 
			if ( is_dir( $Entry ) ) {
				full_copy( $Entry, $target . '/' . $entry );
				continue;
			}
			copy( $Entry, $target . '/' . $entry );
		}
 
		$d->close();
	}else {
		copy( $source, $target );
	}
}

function rmdir_r ( $dir, $DeleteMe = TRUE )
{
	if ( ! $dh = @opendir ( $dir ) ) return;
	while ( false !== ( $obj = readdir ( $dh ) ) )
	{
		if ( $obj == '.' || $obj == '..') continue;
		if ( ! @unlink ( $dir . '/' . $obj ) ) rmdir_r ( $dir . '/' . $obj, true );
	}
	
	closedir ( $dh );
	if ( $DeleteMe )
	{
		@rmdir ( $dir );
	}
}

function insertDefaultValues()
{
                $db = &JFactory::getDBO();
				//$query = setupSQLTransferCleanup();
                //$db->setQuery($query);
                //$db->queryBatch();
                echo JText::_('No backed up found... <br>');
                $configquery = getDefaultConfigSQL();
                $catquery = getDefaultCatSQL();
                $subcatquery = getDefaultSubCatSQL();
                $jobtypequery = getDefaultJobTypeSQL();
                $salquery = getDefaultSalaryRangeSQL();
                $salaryrangetypequery = getDefaultSalaryRangeTypesSQL();
                $educationquery = getDefaultHeighestEducationSQL();
                $jobstatusquery = getDefaultJobStatusSQL();
                $shiftquery = getDefaultShiftSQL();
                $rolequery = getDefaultRoleSQL(); // may remove it
                $emailquery = getDefaultEmailTemplatesSQL();
                $contriesquery = getDefaultContriesSQL();
                $fieldorderingquery = getDefaultFieldOrderingSQL();

                $agequery = getDefaultAgesSQL();
                $careerlevelquery = getDefaultCareerLevelsSQL();
                $experiencequery = getDefaultExperiencesSQL();

                $employerpackagesquery = getDefaultEmployerPackagesSQL();
                $jobseekerpackagesquery = getDefaultJobSeekerPackagesSQL();

                $Pakstatesquery = getDefaultPakStatesSQL();
                $Pakcontiesquery = getDefaultPakCountiesSQL();
                $Pakcitiesquery = getDefaultPakCitiesSQL();

				$currenciesquery = getDefaultCurrenciesSQL();
                
                $db->setQuery($configquery);
                if ( $result = $db->queryBatch())echo JText::_('Deault Configurations insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Configurations.</font><br>');

                $db->setQuery($catquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Categories data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Categories data.</font><br>');

                $db->setQuery($subcatquery);
                if (! $result = $db->queryBatch()) echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Sub-Categories data.</font><br>');

                $db->setQuery($jobtypequery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Job Types data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Job Type data.</font><br>');

                $db->setQuery($salquery);
                if ( $result = $db->queryBatch()) echo JText::_('Deault Salary Range data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Salary Ranges data.</font><br>');

                $db->setQuery($salaryrangetypequery);
                if ( $result = $db->queryBatch()) echo JText::_('Deault Salary Range Types data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Salary Range Types data.</font><br>');

                $db->setQuery($educationquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Heighest Education data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Heighest Education data.</font><br>');

                $db->setQuery($jobstatusquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Job Status data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Job Status data.</font><br>');

                $db->setQuery($shiftquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Shift data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Shift data.</font><br>');

                $db->setQuery($rolequery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Roles data insert successfully!<br>');
				else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Roles data.</font><br>');

                $db->setQuery($emailquery);
                //echo '<br> 6 '.$emailquery;
                if ( $result = $db->queryBatch())	echo JText::_('Deault Email Templates data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Email Templates data.</font><br>');

                $db->setQuery($agequery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Ages data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Ages data.</font><br>');

                $db->setQuery($careerlevelquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Career Levels data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Career Levels data.</font><br>');

                $db->setQuery($experiencequery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Experiences data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Experiences data.</font><br>');

                $db->setQuery($employerpackagesquery);
                //echo '<br> 6 '.$employerpackagesquery;
                if ( $result = $db->queryBatch())	echo JText::_('Deault Employer Packages data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Employer Packages data.</font><br>');

                $db->setQuery($jobseekerpackagesquery);
                //echo '<br> 6 '.$jobseekerpackagesquery;
                if ( $result = $db->queryBatch())	echo JText::_('Deault Job Seeker Packages data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Job Seeker Packages data.</font><br>');

                $db->setQuery($contriesquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Contries data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Contries data.</font><br>');

                $db->setQuery($Pakstatesquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Pakistan States data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Pakistan States data.</font><br>');
                $db->setQuery($Pakcontiesquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Pakistan Districts data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Pakistan Districts data.</font><br>');
                $db->setQuery($Pakcitiesquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Pakistan Cities data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Pakistan Cities data.</font><br>');

                $db->setQuery($fieldorderingquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Field Ordering data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Field Ordering data.</font><br>');

                $db->setQuery($currenciesquery);
                if ( $result = $db->queryBatch())echo JText::_('Deault Currencies insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Currencies.</font><br>');

               return true;

}
function bacupv107($version){
 	$db = &JFactory::getDBO();
           echo JText::_('Database backed up data found v1.0.7.x  ... Beginning transfer ...<br>');
                $query = 'SELECT * FROM '.$db->nameQuote('#__wrecruit_config_bak')." WHERE configname = 'versioncode'";
				$db->setQuery($query);
                $version = $db->loadObject();
            $configquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_config').' SELECT * FROM '.$db->nameQuote('#__wrecruit_config_bak').';';
            $catquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_categories').' SELECT * FROM '.$db->nameQuote('#__wrecruit_categories_bak').';';
            $salaryquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_salaryrange').' SELECT * FROM '.$db->nameQuote('#__wrecruit_salaryrange_bak').';';
			if(($version->configvalue == '107') || ($version->configvalue == '1071') || ($version->configvalue == '1072') || ($version->configvalue == '1073')
			 || ($version->configvalue == '1074') || ($version->configvalue == '1075') || ($version->configvalue == '1076'))			
			{
				$jobquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobs').' SELECT *,1 FROM '.$db->nameQuote('#__wrecruit_jobs_bak').';';
			}else{
				$jobquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobs').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobs_bak').';';
			}		
            $jobapplyquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobapply').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobapply_bak').';';
			if(($version->configvalue == '107') || ($version->configvalue == '1071') || ($version->configvalue == '1072') || ($version->configvalue == '1073')
			 || ($version->configvalue == '1074') || ($version->configvalue == '1075') || ($version->configvalue == '1076'))			
			{
				$jaquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_resume').' SELECT *,1 FROM '.$db->nameQuote('#__wrecruit_resume_bak').';';
			}else{	
				$jaquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_resume').' SELECT * FROM '.$db->nameQuote('#__wrecruit_resume_bak').';';
			}	
            $countriesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_countries').' SELECT * FROM '.$db->nameQuote('#__wrecruit_countries_bak').';';
            $statesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_states').' SELECT * FROM '.$db->nameQuote('#__wrecruit_states_bak').';';
            $countiesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_counties').' SELECT * FROM '.$db->nameQuote('#__wrecruit_counties_bak').';';
            $citiesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_cities').' SELECT * FROM '.$db->nameQuote('#__wrecruit_cities_bak').';';
            $zipsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_zips').' SELECT * FROM '.$db->nameQuote('#__wrecruit_zips_bak').';';


            $companiesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_companies').' SELECT * FROM '.$db->nameQuote('#__wrecruit_companies_bak').';';
            $jobsearchesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobsearches').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobsearches_bak').';';
            $jobstatusquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobstatus').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobstatus_bak').';';
            $jobtypequery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobtypes').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobtypes_bak').';';
            $jobtypequery2 = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobtypes').' (id, title, isactive, status) SELECT id, title, isactive, 1 FROM '.$db->nameQuote('#__wrecruit_jobtypes_bak').';';
            $shiftsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_shifts').' SELECT * FROM '.$db->nameQuote('#__wrecruit_shifts_bak').';';
            $shiftsquery2 = 'INSERT INTO  '.$db->nameQuote('#__wrecruit_shifts').' (id, title, isactive, status) SELECT id, title, isactive, 1 FROM '.$db->nameQuote('#__wrecruit_shifts_bak').';';
            $coverlettersquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_coverletters').' SELECT * FROM '.$db->nameQuote('#__wrecruit_coverletters_bak').';';
            $emailquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_emailtemplates').' SELECT * FROM '.$db->nameQuote('#__wrecruit_emailtemplates_bak').';';
            $fieldorderingquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_fieldsordering').' SELECT * FROM '.$db->nameQuote('#__wrecruit_fieldsordering_bak').';';


            $filtersquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_filters').' SELECT * FROM '.$db->nameQuote('#__wrecruit_filters_bak').';';
            $educationquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_heighesteducation').' SELECT * FROM '.$db->nameQuote('#__wrecruit_heighesteducation_bak').';';
            $resumesearchquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_resumesearches').' SELECT * FROM '.$db->nameQuote('#__wrecruit_resumesearches_bak').';';
            //may delete it
            $rolesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_roles').' SELECT * FROM '.$db->nameQuote('#__wrecruit_roles_bak').';';
            $userfieldsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_userfields').' SELECT * FROM '.$db->nameQuote('#__wrecruit_userfields_bak').';';

            $agessquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_ages').' SELECT * FROM '.$db->nameQuote('#__wrecruit_ages_bak').';';
            $careerleversquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_careerlevels').' SELECT * FROM '.$db->nameQuote('#__wrecruit_careerlevels_bak').';';
            $experiencesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_experiences').' SELECT * FROM '.$db->nameQuote('#__wrecruit_experiences_bak').';';
            $salaryrangetypesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_salaryrangetypes').' SELECT * FROM '.$db->nameQuote('#__wrecruit_salaryrangetypes_bak').';';

            $agessquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_ages').' SELECT * FROM '.$db->nameQuote('#__wrecruit_ages_bak').';';
            $careerleversquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_careerlevels').' SELECT * FROM '.$db->nameQuote('#__wrecruit_careerlevels_bak').';';
            $experiencesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_experiences').' SELECT * FROM '.$db->nameQuote('#__wrecruit_experiences_bak').';';
            $salaryrangetypesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_salaryrangetypes').' SELECT * FROM '.$db->nameQuote('#__wrecruit_salaryrangetypes_bak').';';

            
			$employerpackagesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_employerpackages').' SELECT * FROM '.$db->nameQuote('#__wrecruit_employerpackages_bak').';';
			$jobseekerpackagesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobseekerpackages').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobseekerpackages_bak').';';
            
			$employerpaymenthistoryquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_employerpaymenthistory').' SELECT * FROM '.$db->nameQuote('#__wrecruit_employerpaymenthistory_bak').';';
            $jobseekerpaymenthistoryquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobseekerpaymenthistory').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobseekerpaymenthistory_bak').';';

            $goldcompaniesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_goldcompanies').' SELECT * FROM '.$db->nameQuote('#__wrecruit_goldcompanies_bak').';';
            $featuredcompaniesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_featuredcompanies').' SELECT * FROM '.$db->nameQuote('#__wrecruit_featuredcompanies_bak').';';
            $goldjobsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_goldjobs').' SELECT * FROM '.$db->nameQuote('#__wrecruit_goldjobs_bak').';';
            $featuredjobsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_featuredjobs').' SELECT * FROM '.$db->nameQuote('#__wrecruit_featuredjobs_bak').';';
            $goldresumesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_goldresumes').' SELECT * FROM '.$db->nameQuote('#__wrecruit_goldresumes_bak').';';
            $featuredresumesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_featuredresumes').' SELECT * FROM '.$db->nameQuote('#__wrecruit_featuredresumes_bak').';';

            $departmentsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_departments').' SELECT * FROM '.$db->nameQuote('#__wrecruit_departments_bak').';';
            $shortlistcandidatesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_shortlistcandidates').' SELECT * FROM '.$db->nameQuote('#__wrecruit_shortlistcandidates_bak').';';

            $userfieldvaluequery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_userfieldvalues').' SELECT * FROM '.$db->nameQuote('#__wrecruit_userfieldvalues_bak').';';
            $userfielddataquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_userfield_data').' SELECT * FROM '.$db->nameQuote('#__wrecruit_userfield_data_bak').';';
            //may delete it
            $userrolesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_userroles').' SELECT * FROM '.$db->nameQuote('#__wrecruit_userroles_bak').';';

            $folderresumesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_folderresumes').' SELECT * FROM '.$db->nameQuote('#__wrecruit_folderresumes_bak').';';
            $foldersquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_folders').' SELECT * FROM '.$db->nameQuote('#__wrecruit_folders_bak').';';
            $jobalertsettingquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobalertsetting').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobalertsetting_bak').';';
            $messagesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_messages').' SELECT * FROM '.$db->nameQuote('#__wrecruit_messages_bak').';';
            $resumeratingquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_resumerating').' SELECT * FROM '.$db->nameQuote('#__wrecruit_resumerating_bak').';';
            $subcategoriesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_subcategories').' SELECT * FROM '.$db->nameQuote('#__wrecruit_subcategories_bak').';';
            $currenciesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_currencies').' SELECT * FROM '.$db->nameQuote('#__wrecruit_currencies_bak').';';
			
			
            $db->setQuery($configquery);
            if ( $result = $db->queryBatch()) echo JText::_('Configurations Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Configurations.</font><br>');

			$configupdate = getUpdateConfigSQL();
			$db->setQuery($configupdate);
			if ( $result = $db->queryBatch())
				echo JText::_('Configurations update successfully!<br>');
			else{
				echo "<font color='red'>".JText::_('Error occurred while attempting to update configurations.</font><br>');
				//return false;
			}

            $db->setQuery($catquery);
            if ( $result = $db->queryBatch()) echo JText::_('Categories Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Categories data.</font><br>');

            $db->setQuery($salaryquery);
            if ( $result = $db->queryBatch()) echo JText::_('Salary Range Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Salary Range data.</font><br>');

            $db->setQuery($salaryrangetypesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Salary Range Types Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Salary Range Types data.</font><br>');

            $db->setQuery($jobquery);
            if ( $result = $db->queryBatch())	echo JText::_('Job Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job data.</font><br>');

            $db->setQuery($jobapplyquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Apply Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Apply data.</font><br>');

            $db->setQuery($jaquery);
            if ( $result = $db->queryBatch()) echo JText::_('Resume Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Resume data.</font><br>');

            $db->setQuery($companiesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Companies Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Companies data.</font><br>');

            $db->setQuery($jobsearchesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Searches Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Searches data.</font><br>');

            $db->setQuery($jobstatusquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Status Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Status data.</font><br>');

            $db->setQuery($jobtypequery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Types Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Types data.</font><br>');

            $db->setQuery($shiftsquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Shifts Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Shifts data.</font><br>');

            $db->setQuery($coverlettersquery);
            if ( $result = $db->queryBatch()) echo JText::_('Cover Letters Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Cover Letters data.</font><br>');

            $db->setQuery($emailquery);
            if ( $result = $db->queryBatch()) echo JText::_('Email Templates Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Email Templates data.</font><br>');
			
            $db->setQuery($fieldorderingquery);
            if ( $result = $db->queryBatch()) echo JText::_('Field Ordering Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Field Ordering data.</font><br>');
		if(($version->configvalue == '107') || ($version->configvalue == '1071') || ($version->configvalue == '1072') || ($version->configvalue == '1073'))			
		{
				$fieldorderingupdatequery = 'UPDATE '.$db->nameQuote('#__wrecruit_fieldsordering').' SET ordering = ordering + 20 WHERE fieldfor = 3 AND ordering > 20;';
				$db->setQuery($fieldorderingupdatequery);
				if ( $result = $db->queryBatch()){
					$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')."  (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES  ( 'section_userfields', 'User Fields', '21', '1000', '3', '0', '0', '0', '0');";
					$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES  ( 'userfield1', 'User Field 1', '22', '1000', '3', '0', '0', '0', '0');";
					$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`)  VALUES ( 'userfield2', 'User Field 2', '23', '1000', '3', '0', '0', '0', '0');";
					$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield3', 'User Field 3', '24', '1000', '3', '0', '0', '0', '0');";
					$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`)  VALUES ( 'userfield4', 'User Field 4', '25', '1000', '3', '0', '0', '0', '0');";
					$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`)  VALUES ( 'userfield5', 'User Field 5', '26', '1000', '3', '0', '0', '0', '0');";
					$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield6', 'User Field 6', '27', '1000', '3', '0', '0', '0', '0');";
					$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield7', 'User Field 7', '28', '1000', '3', '0', '0', '0', '0');";
					$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield8', 'User Field 8', '29', '1000', '3', '0', '0', '0', '0');";
					$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield9', 'User Field 9', '30', '1000', '3', '0', '0', '0', '0');";
					$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield10', 'User Field 10', '31', '1000', '3', '0', '0', '0', '0');";
					$db->setQuery($sql);
					if ( $result = $db->queryBatch())
						echo JText::_('Field Ordering update successfully!<br>');
					else echo "<font color='red'>".JText::_('Error occurred while attempting to update Field Ordering data.</font><br>');
				}else echo "<font color='red'>".JText::_('Error occurred while attempting to update Field Ordering data.</font><br>');
			}

            $db->setQuery($filtersquery);
            if ( $result = $db->queryBatch()) echo JText::_('Filters Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Filters data.</font><br>');

            $db->setQuery($educationquery);
            if ( $result = $db->queryBatch()) echo JText::_('Heighest Education Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Heighest Education data.</font><br>');

            $db->setQuery($resumesearchquery);
            if ( $result = $db->queryBatch()) echo JText::_('Resume Searches Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Resume Searches data.</font><br>');

            $db->setQuery($rolesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Roles Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Roles data.</font><br>');

            $db->setQuery($userfieldsquery);
            if ( $result = $db->queryBatch()) echo JText::_('User Fields Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up User Fields data.</font><br>');

            $db->setQuery($userfieldvaluequery);
            if ( $result = $db->queryBatch()) echo JText::_('User Field Values Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up User Field Values data.</font><br>');

            $db->setQuery($userfielddataquery);
            if ( $result = $db->queryBatch()) echo JText::_('User Field Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up User Field data.</font><br>');

            $db->setQuery($userrolesquery);
            if ( $result = $db->queryBatch()) echo JText::_('User Roles Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up User Roles data.</font><br>');

            $db->setQuery($agessquery);
            if ( $result = $db->queryBatch()) echo JText::_('Ages Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Ages data.</font><br>');

            $db->setQuery($careerleversquery);
            if ( $result = $db->queryBatch()) echo JText::_('Career Levels Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Career Levels data.</font><br>');

            $db->setQuery($experiencesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Experiences Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Experiences data.</font><br>');

            $db->setQuery($employerpackagesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Employer Packages Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Employer Packages data.</font><br>');

            $db->setQuery($employerpaymenthistoryquery);
            if ( $result = $db->queryBatch()) echo JText::_('Employer Payment History Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Employer Payment History data.</font><br>');

            $db->setQuery($jobseekerpackagesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Seeker Packages Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Seeker Packages data.</font><br>');

            $db->setQuery($jobseekerpaymenthistoryquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Seeker Payment History Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Seeker Payment History data.</font><br>');

            $db->setQuery($goldcompaniesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Gold Companies Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Gold Companies data.</font><br>');

            $db->setQuery($featuredcompaniesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Featured Companies Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Featured Companies data.</font><br>');

            $db->setQuery($goldjobsquery);
            if ( $result = $db->queryBatch()) echo JText::_('Gold Jobs Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Gold Jobs data.</font><br>');

            $db->setQuery($featuredjobsquery);
            if ( $result = $db->queryBatch()) echo JText::_('Featured Jobs Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Featurd Jobs data.</font><br>');

            $db->setQuery($goldresumesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Gold Resumes Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Gold Resumes data.</font><br>');

            $db->setQuery($featuredresumesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Featured Resume Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Featured Resume data.</font><br>');

            $db->setQuery($departmentsquery);
            if ( $result = $db->queryBatch()) echo JText::_('Departments Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Departments data.</font><br>');

            $db->setQuery($shortlistcandidatesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Short List Candidates Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Short List Candidates data.</font><br>');

            $db->setQuery($countriesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Countries Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Countries data.</font><br>');

            $db->setQuery($statesquery);
            if ( $result = $db->queryBatch())	echo JText::_('States Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up States data.</font><br>');

            $db->setQuery($countiesquery);
            if ( $result = $db->queryBatch())	echo JText::_('Counties Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Counties data.</font><br>');

            $db->setQuery($citiesquery);
            if (! $result = $db->queryBatch()) echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Cities data.</font><br>');

            $db->setQuery($zipsquery);
            if (! $result = $db->queryBatch()) echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Zips data.</font><br>');

            $db->setQuery($folderresumesquery);
            if (! $result = $db->queryBatch()) echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Folder Resume data.</font><br>');
            
            $db->setQuery($foldersquery);
            if (! $result = $db->queryBatch()) echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Folders data.</font><br>');

            $db->setQuery($jobalertsettingquery);
            if (! $result = $db->queryBatch()) echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Alert Settings data.</font><br>');

            $db->setQuery($messagesquery);
            if (! $result = $db->queryBatch()) echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Messages data.</font><br>');

            $db->setQuery($resumeratingquery);
            if (! $result = $db->queryBatch()) echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Resume Rating data.</font><br>');

            $db->setQuery($subcategoriesquery);
            if (! $result = $db->queryBatch()) echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Sub Categories data.</font><br>');

			if(($version->configvalue == '107') || ($version->configvalue == '1071') || ($version->configvalue == '1072') || ($version->configvalue == '1073')			
				|| ($version->configvalue == '1074') || ($version->configvalue == '1075') || ($version->configvalue == '1076')){			
				$currenciesquery = getDefaultCurrenciesForUpdateSQL();
				$db->setQuery($currenciesquery);
				if (! $result = $db->queryBatch()) "<font color='red'>".JText::_('Error occurred while attempting to inserting default Currencies.</font><br>');
			
				$db->setQuery('UPDATE '.$db->nameQuote('#__wrecruit_jobs').' SET currencyid = 1');
				if (! $result = $db->query()) "<font color='red'>".JText::_('Error occurred while attempting to Job default Currencies.</font><br>');
			}else{
				$db->setQuery($currenciesquery);
				if (! $result = $db->queryBatch()) "<font color='red'>".JText::_('Error occurred while attempting to inserting default Currencies.</font><br>');
			}
           $clquery = setupSQLTransferCleanup();
            //echo '<br> clean '.$clquery;
            $db->setQuery($clquery);
            $db->queryBatch();

}
function bacupv106($version){
 	$db = &JFactory::getDBO();
           echo JText::_('Database backed up data found v1.0.6.x  ... Beginning transfer ...<br>');
                $query = 'SELECT * FROM '.$db->nameQuote('#__wrecruit_config_bak')." WHERE configname = 'versioncode'";
				$db->setQuery($query);
                $version = $db->loadObject();
            $configquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_config').' SELECT * FROM '.$db->nameQuote('#__wrecruit_config_bak').';';
			// insert extra configurations
            $catquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_categories').' SELECT * FROM '.$db->nameQuote('#__wrecruit_categories_bak').';';
            $salaryquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_salaryrange').' SELECT * FROM '.$db->nameQuote('#__wrecruit_salaryrange_bak').';';
            $jobquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobs').' SELECT *,"",1 FROM '.$db->nameQuote('#__wrecruit_jobs_bak').';';
            $jobapplyquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobapply').' SELECT *,"" FROM '.$db->nameQuote('#__wrecruit_jobapply_bak').';';
            $jaquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_resume').' SELECT *,"","","","","","","","","","",1 FROM '.$db->nameQuote('#__wrecruit_resume_bak').';';

            $countriesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_countries').' SELECT * FROM '.$db->nameQuote('#__wrecruit_countries_bak').';';
            $statesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_states').' SELECT * FROM '.$db->nameQuote('#__wrecruit_states_bak').';';
            $countiesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_counties').' SELECT * FROM '.$db->nameQuote('#__wrecruit_counties_bak').';';
            $citiesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_cities').' SELECT * FROM '.$db->nameQuote('#__wrecruit_cities_bak').';';
            $zipsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_zips').' SELECT * FROM '.$db->nameQuote('#__wrecruit_zips_bak').';';


            $companiesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_companies').' SELECT * FROM '.$db->nameQuote('#__wrecruit_companies_bak').';';
            $jobsearchesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobsearches').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobsearches_bak').';';
            $jobstatusquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobstatus').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobstatus_bak').';';
            $jobtypequery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobtypes').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobtypes_bak').';';
            $jobtypequery2 = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobtypes').' (id, title, isactive, status) SELECT id, title, isactive, 1 FROM '.$db->nameQuote('#__wrecruit_jobtypes_bak').';';
            $shiftsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_shifts').' SELECT * FROM '.$db->nameQuote('#__wrecruit_shifts_bak').';';
            $shiftsquery2 = 'INSERT INTO  '.$db->nameQuote('#__wrecruit_shifts').' (id, title, isactive, status) SELECT id, title, isactive, 1 FROM '.$db->nameQuote('#__wrecruit_shifts_bak').';';
            $coverlettersquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_coverletters').' SELECT * FROM '.$db->nameQuote('#__wrecruit_coverletters_bak').';';
            $emailquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_emailtemplates').' SELECT * FROM '.$db->nameQuote('#__wrecruit_emailtemplates_bak').';';
            $fieldorderingquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_fieldsordering').' SELECT * FROM '.$db->nameQuote('#__wrecruit_fieldsordering_bak').';';


            $filtersquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_filters').' SELECT * FROM '.$db->nameQuote('#__wrecruit_filters_bak').';';
            $educationquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_heighesteducation').' SELECT * FROM '.$db->nameQuote('#__wrecruit_heighesteducation_bak').';';
            $resumesearchquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_resumesearches').' SELECT * FROM '.$db->nameQuote('#__wrecruit_resumesearches_bak').';';
            //may delete it
            $rolesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_roles').' SELECT * FROM '.$db->nameQuote('#__wrecruit_roles_bak').';';
            $userfieldsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_userfields').' SELECT * FROM '.$db->nameQuote('#__wrecruit_userfields_bak').';';

            $agessquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_ages').' SELECT * FROM '.$db->nameQuote('#__wrecruit_ages_bak').';';
            $careerleversquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_careerlevels').' SELECT * FROM '.$db->nameQuote('#__wrecruit_careerlevels_bak').';';
            $experiencesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_experiences').' SELECT * FROM '.$db->nameQuote('#__wrecruit_experiences_bak').';';
            $salaryrangetypesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_salaryrangetypes').' SELECT * FROM '.$db->nameQuote('#__wrecruit_salaryrangetypes_bak').';';

            
			if(($version  == '106') || ($version  == '1061')){
				$employerpackagesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_employerpackages').' SELECT *,"","",0,0 FROM '.$db->nameQuote('#__wrecruit_employerpackages_bak').';';
				$jobseekerpackagesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobseekerpackages').' SELECT *,"","",1 FROM '.$db->nameQuote('#__wrecruit_jobseekerpackages_bak').';';
			}else{ // 1062 and +
				$employerpackagesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_employerpackages').' SELECT *,0,0 FROM '.$db->nameQuote('#__wrecruit_employerpackages_bak').';';
				$jobseekerpackagesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobseekerpackages').' SELECT *,1 FROM '.$db->nameQuote('#__wrecruit_jobseekerpackages_bak').';';
			}
            $employerpaymenthistoryquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_employerpaymenthistory').' SELECT * FROM '.$db->nameQuote('#__wrecruit_employerpaymenthistory_bak').';';
            $jobseekerpaymenthistoryquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobseekerpaymenthistory').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobseekerpaymenthistory_bak').';';

            $goldcompaniesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_goldcompanies').' SELECT * FROM '.$db->nameQuote('#__wrecruit_goldcompanies_bak').';';
            $featuredcompaniesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_featuredcompanies').' SELECT * FROM '.$db->nameQuote('#__wrecruit_featuredcompanies_bak').';';
            $goldjobsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_goldjobs').' SELECT * FROM '.$db->nameQuote('#__wrecruit_goldjobs_bak').';';
            $featuredjobsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_featuredjobs').' SELECT * FROM '.$db->nameQuote('#__wrecruit_featuredjobs_bak').';';
            $goldresumesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_goldresumes').' SELECT * FROM '.$db->nameQuote('#__wrecruit_goldresumes_bak').';';
            $featuredresumesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_featuredresumes').' SELECT * FROM '.$db->nameQuote('#__wrecruit_featuredresumes_bak').';';

            $departmentsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_departments').' SELECT * FROM '.$db->nameQuote('#__wrecruit_departments_bak').';';
            $shortlistcandidatesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_shortlistcandidates').' SELECT * FROM '.$db->nameQuote('#__wrecruit_shortlistcandidates_bak').';';

            $userfieldvaluequery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_userfieldvalues').' SELECT * FROM '.$db->nameQuote('#__wrecruit_userfieldvalues_bak').';';
            $userfielddataquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_userfield_data').' SELECT * FROM '.$db->nameQuote('#__wrecruit_userfield_data_bak').';';
            //may delete it
            $userrolesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_userroles').' SELECT * FROM '.$db->nameQuote('#__wrecruit_userroles_bak').';';
			
			$currenciesquery = getDefaultCurrenciesForUpdateSQL();

            $db->setQuery($configquery);
            if ( $result = $db->queryBatch()) echo JText::_('Configurations Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Configurations.</font><br>');

			$configupdate = getUpdateConfigSQL();
			$db->setQuery($configupdate);
			if ( $result = $db->queryBatch())
				echo JText::_('Configurations update successfully!<br>');
			else{
				echo "<font color='red'>".JText::_('Error occurred while attempting to update configurations.</font><br>');
				//return false;
			}

            $db->setQuery($catquery);
            if ( $result = $db->queryBatch()) echo JText::_('Categories Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Categories data.</font><br>');

            $db->setQuery($salaryquery);
            if ( $result = $db->queryBatch()) echo JText::_('Salary Range Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Salary Range data.</font><br>');

            $db->setQuery($salaryrangetypesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Salary Range Types Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Salary Range Types data.</font><br>');

            $db->setQuery($jobquery);
            if ( $result = $db->queryBatch())	echo JText::_('Job Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job data.</font><br>');

            $db->setQuery($jobapplyquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Apply Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Apply data.</font><br>');

            $db->setQuery($jaquery);
            if ( $result = $db->queryBatch()) echo JText::_('Resume Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Resume data.</font><br>');

            $db->setQuery($companiesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Companies Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Companies data.</font><br>');

            $db->setQuery($jobsearchesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Searches Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Searches data.</font><br>');

            $db->setQuery($jobstatusquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Status Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Status data.</font><br>');

            $db->setQuery($jobtypequery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Types Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Types data.</font><br>');

            $db->setQuery($shiftsquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Shifts Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Shifts data.</font><br>');

            $db->setQuery($coverlettersquery);
            if ( $result = $db->queryBatch()) echo JText::_('Cover Letters Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Cover Letters data.</font><br>');

            $db->setQuery($emailquery);
            if ( $result = $db->queryBatch()) echo JText::_('Email Templates Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Email Templates data.</font><br>');
			$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (15,0,'message-email',NULL,'WRecruit: New Message Alert','<p>Dear {NAME},</p><p>{SENDER_NAME}: send you new message.</p><p><strong><span >Summary</span></strong></p><p>Company Name: {COMPANY_NAME}</p><p>Job Title: {JOB_TITLE}</p><p>Resume Title: {RESUME_TITLE}</p>',NULL,'2011-03-31 16:46:16');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (16,0,'job-alert',NULL,'WRecruit: New Job','<p>Dear Job Seekers , </p><p> We receive new job.</p><p> Title: {JOB_TITLE}</p><p> Category: {CATEGORY}</p><p> Sub category: {SUB_CATEGORY}</p><p> Location: {LOCATION}</p><p> Login and view detail at  Please do not respond to this message. It is automatically generated and is for information purposes only.</p>	',NULL,'2011-03-31 16:46:16');";
//	echo '<br> email template 2 '.$sql;
            $db->setQuery($sql);
            if ( $result = $db->queryBatch()) echo JText::_('Email Templates installed successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to install new Email Templates data.</font><br>');

            $db->setQuery($fieldorderingquery);
            if ( $result = $db->queryBatch()) echo JText::_('Field Ordering Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Field Ordering data.</font><br>');
			$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`, `section` , `fieldfor`, `published`, `sys` , `cannotunpublish` , `required`) VALUES ('subcategory', 'Sub Category', '5', null, '2', '1', '1', '0', '0');";
			$db->setQuery($sql);
			
            $db->setQuery($filtersquery);
            if ( $result = $db->queryBatch()) echo JText::_('Filters Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Filters data.</font><br>');

            $db->setQuery($educationquery);
            if ( $result = $db->queryBatch()) echo JText::_('Heighest Education Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Heighest Education data.</font><br>');

            $db->setQuery($resumesearchquery);
            if ( $result = $db->queryBatch()) echo JText::_('Resume Searches Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Resume Searches data.</font><br>');

            $db->setQuery($rolesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Roles Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Roles data.</font><br>');

            $db->setQuery($userfieldsquery);
            if ( $result = $db->queryBatch()) echo JText::_('User Fields Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up User Fields data.</font><br>');

            $db->setQuery($userfieldvaluequery);
            if ( $result = $db->queryBatch()) echo JText::_('User Field Values Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up User Field Values data.</font><br>');

            $db->setQuery($userfielddataquery);
            if ( $result = $db->queryBatch()) echo JText::_('User Field Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up User Field data.</font><br>');

            $db->setQuery($userrolesquery);
            if ( $result = $db->queryBatch()) echo JText::_('User Roles Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up User Roles data.</font><br>');

            $db->setQuery($agessquery);
            if ( $result = $db->queryBatch()) echo JText::_('Ages Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Ages data.</font><br>');

            $db->setQuery($careerleversquery);
            if ( $result = $db->queryBatch()) echo JText::_('Career Levels Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Career Levels data.</font><br>');

            $db->setQuery($experiencesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Experiences Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Experiences data.</font><br>');

            $db->setQuery($employerpackagesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Employer Packages Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Employer Packages data.</font><br>');

            $db->setQuery($employerpaymenthistoryquery);
            if ( $result = $db->queryBatch()) echo JText::_('Employer Payment History Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Employer Payment History data.</font><br>');

            $db->setQuery($jobseekerpackagesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Seeker Packages Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Seeker Packages data.</font><br>');

            $db->setQuery($jobseekerpaymenthistoryquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Seeker Payment History Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Seeker Payment History data.</font><br>');

            $db->setQuery($goldcompaniesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Gold Companies Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Gold Companies data.</font><br>');

            $db->setQuery($featuredcompaniesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Featured Companies Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Featured Companies data.</font><br>');

            $db->setQuery($goldjobsquery);
            if ( $result = $db->queryBatch()) echo JText::_('Gold Jobs Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Gold Jobs data.</font><br>');

            $db->setQuery($featuredjobsquery);
            if ( $result = $db->queryBatch()) echo JText::_('Featured Jobs Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Featurd Jobs data.</font><br>');

            $db->setQuery($goldresumesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Gold Resumes Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Gold Resumes data.</font><br>');

            $db->setQuery($featuredresumesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Featured Resume Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Featured Resume data.</font><br>');

            $db->setQuery($departmentsquery);
            if ( $result = $db->queryBatch()) echo JText::_('Departments Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Departments data.</font><br>');

            $db->setQuery($shortlistcandidatesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Short List Candidates Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Short List Candidates data.</font><br>');

            $db->setQuery($countriesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Countries Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Countries data.</font><br>');

            $db->setQuery($statesquery);
            if ( $result = $db->queryBatch())	echo JText::_('States Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up States data.</font><br>');

            $db->setQuery($countiesquery);
            if ( $result = $db->queryBatch())	echo JText::_('Counties Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Counties data.</font><br>');

            $db->setQuery($citiesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Cities Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Cities data.</font><br>');

            $db->setQuery($zipsquery);
            if ( $result = $db->queryBatch())	echo JText::_('Zips Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Zips data.</font><br>');


			$db->setQuery($currenciesquery);
			if (! $result = $db->queryBatch()) "<font color='red'>".JText::_('Error occurred while attempting to inserting default Currencies.</font><br>');

   			$db->setQuery('UPDATE '.$db->nameQuote('#__wrecruit_jobs').' SET currencyid = 1');
			if (! $result = $db->query()) "<font color='red'>".JText::_('Error occurred while attempting to Job default Currencies.</font><br>');

         $clquery = setupSQLTransferCleanup();
            //echo '<br> clean '.$clquery;
            $db->setQuery($clquery);
            $db->queryBatch();

}
function bacupv105()
{
 	$db = &JFactory::getDBO();
           $str=JPATH_BASE;
            $base = substr($str, 0,strlen($str)-14); //remove administrator
			$newpath =$base.'/wrecruitdata';
			if (!file_exists($newpath)){ // create wrecruitdata directory
				mkdir($newpath, 0755);
			}
			$newpath =$base.'/wrecruitdata/data';
			if (!file_exists($newpath)){ // create data directory
				mkdir($newpath, 0755);
			}
            $newpath =$base.'/wrecruitdata/data/';
            $path =$base.'/components/wrecruit_data_bak';
            if (file_exists($path)){
                    full_copy($path, $newpath);
                    echo '<br>Resume Directory Retrieved<br> ';
                    rmdir_r($path,1);
            }
            echo JText::_('Database backed up data found v1.0.5.x  ... Beginning transfer ...<br>');
            $configquery = getDefaultConfigSQL();
            
            $catquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_categories').' SELECT * FROM '.$db->nameQuote('#__wrecruit_categories_bak').';';
            $salaryquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_salaryrange').' SELECT * FROM '.$db->nameQuote('#__wrecruit_salaryrange_bak').';';
            $jobquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobs')." SELECT job.*,2,job.heighestfinisheducation,0,0,1,'',0,1,0,0,0,1,'','',0,0,0,job.jobsalaryrange,0,0,0,0,urole.role,urole.id,'',1 FROM ".$db->nameQuote('#__wrecruit_jobs_bak').'AS job JOIN '.$db->nameQuote('#__wrecruit_userroles_bak').' AS urole ON urole.uid = job.uid GROUP BY job.id, urole.role;';

            $jobapplyquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobapply').' SELECT *,1,"" FROM '.$db->nameQuote('#__wrecruit_jobapply_bak').';';
            $jaquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_resume').' SELECT resume.*,urole.role,urole.id,"","","","","","","","","","",1 FROM '.$db->nameQuote('#__wrecruit_resume_bak').' AS resume JOIN '.$db->nameQuote('#__wrecruit_userroles_bak').' AS urole ON urole.uid = resume.uid GROUP BY resume.id, urole.role;';
                
            $countriesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_countries').' SELECT * FROM '.$db->nameQuote('#__wrecruit_countries_bak').';';
            $statesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_states').' SELECT * FROM '.$db->nameQuote('#__wrecruit_states_bak').';';
            $countiesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_counties').' SELECT * FROM '.$db->nameQuote('#__wrecruit_counties_bak').';';
            $citiesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_cities').' SELECT * FROM '.$db->nameQuote('#__wrecruit_cities_bak').';';
            $zipsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_zips').' SELECT * FROM '.$db->nameQuote('#__wrecruit_zips_bak').';';

            $companiesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_companies').' SELECT company.*,urole.role,urole.id FROM '.$db->nameQuote('#__wrecruit_companies_bak').' AS company JOIN '.$db->nameQuote('#__wrecruit_userroles_bak').' AS urole ON urole.uid = company.uid GROUP BY company.id, urole.role;';


            
            $jobsearchesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobsearches').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobsearches_bak').';';
            $jobstatusquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobstatus').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobstatus_bak').';';
            $jobtypequery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobtypes').' SELECT * FROM '.$db->nameQuote('#__wrecruit_jobtypes_bak').';';
			$jobtypequery2 = 'INSERT INTO '.$db->nameQuote('#__wrecruit_jobtypes').' (id, title, isactive, status) SELECT id, title, isactive, 1 FROM '.$db->nameQuote('#__wrecruit_jobtypes_bak').';';
            $shiftsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_shifts').' SELECT * FROM '.$db->nameQuote('#__wrecruit_shifts_bak').';';
			$shiftsquery2 = 'INSERT INTO  '.$db->nameQuote('#__wrecruit_shifts').' (id, title, isactive, status) SELECT id, title, isactive, 1 FROM '.$db->nameQuote('#__wrecruit_shifts_bak').';';
            $coverlettersquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_coverletters').' SELECT cletter.*,urole.role,urole.id FROM '.$db->nameQuote('#__wrecruit_coverletters_bak').' AS cletter JOIN '.$db->nameQuote('#__wrecruit_userroles_bak').' AS urole ON urole.uid = cletter.uid GROUP BY cletter.id, urole.role;';
            $emailquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_emailtemplates').' SELECT * FROM '.$db->nameQuote('#__wrecruit_emailtemplates_bak').';';
            $fieldorderingquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_fieldsordering').' SELECT *,0 FROM '.$db->nameQuote('#__wrecruit_fieldsordering_bak').';';

            $employerpackagesquery = "INSERT INTO ".$db->nameQuote('#__wrecruit_employerpackages')." SELECT id,title,0,0,0,'','','',companies,jobs,-1,searchresume,savesearchresume,0,0,CURDATE(),0,0,1,'Free Package','Free Package',published,1,1,10000,0,0,0,0,0,0,0,'','',0,0 FROM ".$db->nameQuote('#__wrecruit_roles_bak')." WHERE rolefor = 1;";
            $jobseekerpackagesquery = "INSERT INTO ".$db->nameQuote('#__wrecruit_jobseekerpackages')." SELECT id,title,0,0,0,'','','',resumes,coverletters,-1,searchjob,savesearchjob,0,0,1,10000,'Free Package','Free Package',published,CURDATE(),0,0,'','',1 FROM ".$db->nameQuote('#__wrecruit_roles_bak')." WHERE rolefor = 2;";

            $employerpaymenthistoryquery = "INSERT INTO ".$db->nameQuote('#__wrecruit_employerpaymenthistory')." (id,uid,packageid,paidamount,STATUS,created,transactionverified,transactionautoverified,verifieddate)
                                        SELECT urole.id,urole.uid,urole.role,0,1,urole.dated,1,1,urole.dated FROM ".$db->nameQuote('#__wrecruit_userroles_bak')." AS urole JOIN ".$db->nameQuote('#__wrecruit_roles_bak')." AS role ON role.id = urole.role WHERE role.rolefor = 1;";
            $jobseekerpaymenthistoryquery = "INSERT INTO ".$db->nameQuote('#__wrecruit_jobseekerpaymenthistory')." (id,uid,packageid,paidamount,STATUS,created,transactionverified,transactionautoverified,verifieddate)
                                        SELECT urole.id,urole.uid,urole.role,0,1,urole.dated,1,1,urole.dated FROM ".$db->nameQuote('#__wrecruit_userroles_bak')." AS urole JOIN ".$db->nameQuote('#__wrecruit_roles_bak')." AS role ON role.id = urole.role WHERE role.rolefor = 2;";

            $filtersquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_filters').' SELECT * FROM '.$db->nameQuote('#__wrecruit_filters_bak').';';
            $educationquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_heighesteducation').' SELECT * FROM '.$db->nameQuote('#__wrecruit_heighesteducation_bak').';';
            $resumesearchquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_resumesearches').' SELECT * FROM '.$db->nameQuote('#__wrecruit_resumesearches_bak').';';
            
			//may no need
            //$rolesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_roles').' SELECT * FROM '.$db->nameQuote('#__wrecruit_roles_bak').';';
			$rolesquery = getDefaultRoleSQL();
            
            $userfieldsquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_userfields').' SELECT * FROM '.$db->nameQuote('#__wrecruit_userfields_bak').';';

            $userfieldvaluequery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_userfieldvalues').' SELECT * FROM '.$db->nameQuote('#__wrecruit_userfieldvalues_bak').';';
            $userfielddataquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_userfield_data').' SELECT * FROM '.$db->nameQuote('#__wrecruit_userfield_data_bak').';';
            $userrolesquery = 'INSERT INTO '.$db->nameQuote('#__wrecruit_userroles').' SELECT * FROM '.$db->nameQuote('#__wrecruit_userroles_bak').';';
			
			$currenciesquery = getDefaultCurrenciesForUpdateSQL();

                $salaryrangetypequery = getDefaultSalaryRangeTypesSQL();
                $agequery = getDefaultAgesSQL();
                $careerlevelquery = getDefaultCareerLevelsSQL();
                $experiencequery = getDefaultExperiencesSQL();

                $db->setQuery($salaryrangetypequery);
                if ( $result = $db->queryBatch()) echo JText::_('Deault Salary Range Types data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Salary Range Types data.</font><br>');

                $db->setQuery($agequery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Ages data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Ages data.</font><br>');

                $db->setQuery($careerlevelquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Career Levels data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Career Levels data.</font><br>');

                $db->setQuery($experiencequery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Experiences data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Experiences data.</font><br>');

                $db->setQuery($employerpackagesquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Employer Packages data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Employer Packages data.</font><br>');

                $db->setQuery($jobseekerpackagesquery);
                if ( $result = $db->queryBatch())	echo JText::_('Deault Job Seeker Packages data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Job Seeker Packages data.</font><br>');

                $db->setQuery($employerpaymenthistoryquery);
                if ( $result = $db->queryBatch())	echo JText::_('Employer Payment data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Employer Payment data.</font><br>');

                $db->setQuery($jobseekerpaymenthistoryquery);
                if ( $result = $db->queryBatch())	echo JText::_('Job Seeker Payment data insert successfully!<br>');
                else echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Job Seeker Payment data.</font><br>');

	            //$db->setQuery($configquery);
				//	echo '<br> config package '.$configquery;
	            //if ( $result = $db->queryBatch()) echo JText::_('Configurations Retrieved backed up data successfully!<br>');

	            //else{
                    $configquery = getDefaultConfigSQL();
                    $db->setQuery($configquery);
                    if ( $result = $db->queryBatch())
                            echo JText::_('Deault Configurations insert successfully!<br>');
                    else{
                            echo "<font color='red'>".JText::_('Error occurred while attempting to inserting default Configurations.</font><br>');
                    }
				//}

            //$configupdate = getUpdateConfigSQL();
            //$db->setQuery($configupdate);
            //if ( $result = $db->queryBatch())
            //        echo JText::_('Configurations update successfully!<br>');
            //else{
            //        echo "<font color='red'>".JText::_('Error occurred while attempting to update configurations.</font><br>');
                    //return false;
            //}

            $db->setQuery($catquery);
            if ( $result = $db->queryBatch()) echo JText::_('Categories Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Categories data.</font><br>');

            $db->setQuery($salaryquery);
            if ( $result = $db->queryBatch()) echo JText::_('Salary Range Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Salary Range data.</font><br>');

            $db->setQuery($jobquery);
            if ( $result = $db->queryBatch())	echo JText::_('Job Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job data.</font><br>');

            $db->setQuery($jobapplyquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Apply Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Apply data.</font><br>');


            $db->setQuery($jaquery);
            if ( $result = $db->queryBatch()) echo JText::_('Resume Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Resume data.</font><br>');

            $db->setQuery($companiesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Companies Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Companies data.</font><br>');

            $db->setQuery($jobsearchesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Searches Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Searches data.</font><br>');

            $db->setQuery($jobstatusquery);
            if ( $result = $db->queryBatch()) echo JText::_('Job Status Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Status data.</font><br>');

			$db->setQuery($jobtypequery);
			if ( $result = $db->queryBatch()) {
				echo JText::_('Job Types Retrieved backed up data successfully!<br>');
			}else {
				$db->setQuery($jobtypequery2);
				if ( $result = $db->queryBatch()) echo JText::_('Job Types Retrieved backed up data successfully!<br>');
				else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Types data.</font><br>');
			}
            
			$db->setQuery($shiftsquery);
			if ( $result = $db->queryBatch()) {
				echo JText::_('Job Shifts Retrieved backed up data successfully!<br>');
			}else {
				$db->setQuery($shiftsquery2);
				if ( $result = $db->queryBatch()) echo JText::_('Job Shifts Retrieved backed up data successfully!<br>');
				else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Job Shifts data.</font><br>');
			}	

            $db->setQuery($coverlettersquery);
            if ( $result = $db->queryBatch()) echo JText::_('Cover Letters Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Cover Letters data.</font><br>');

            $db->setQuery($emailquery);
            if ( $result = $db->queryBatch()) echo JText::_('Email Templates Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Email Templates data.</font><br>');

			$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (9,0,'company-new',NULL,'WRecruit : New Company {COMPANY_NAME} has beed received','<p>Hello Admin , </p><p> We receive new company.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (10,0,'job-new',NULL,'WRecruit : New Job {JOB_TITLE} has beed received','<p>Hello Admin , </p><p> We receive new job.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (11,0,'resume-new',NULL,'WRecruit :  New resume {RESUME_TITLE} has beed received','<p>Hello Admin , </p><p> We receive new resume.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (12,0,'department-new',NULL,'WRecruit : New Department {DEPARTMENT_NAME} {COMPANY_NAME} has beed received','<p>Hello Admin , </p><p> We receive new department.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (13,0,'employer-buypackage',NULL,'WRecruit : Employer Buy Package {PACKAGE_NAME}','<p>Hello Admin , </p><p> Employer buy a package.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (14,0,'jobseeker-buypackage',NULL,'WRecruit : Jobseeker Buy Package {PACKAGE_NAME}','<p>Hello Admin , </p><p> Job Seeker buy package.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (15,0,'message-email',NULL,'WRecruit: New Message Alert','<p>Dear {NAME},</p><p>{SENDER_NAME}: send you new message.</p><p><strong><span >Summary</span></strong></p><p>Company Name: {COMPANY_NAME}</p><p>Job Title: {JOB_TITLE}</p><p>Resume Title: {RESUME_TITLE}</p>',NULL,'2011-03-31 16:46:16');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (16,0,'job-alert',NULL,'WRecruit: New Job','<p>Dear Job Seekers , </p><p> We receive new job.</p><p> Title: {JOB_TITLE}</p><p> Category: {CATEGORY}</p><p> Sub category: {SUB_CATEGORY}</p><p> Location: {LOCATION}</p><p> Login and view detail at  Please do not respond to this message. It is automatically generated and is for information purposes only.</p>	',NULL,'2011-03-31 16:46:16');";
//	echo '<br> email template 2 '.$sql;
            $db->setQuery($sql);
            if ( $result = $db->queryBatch()) echo JText::_('Email Templates installed successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to install new Email Templates data.</font><br>');

            $db->setQuery($fieldorderingquery);
            if ( $result = $db->queryBatch()) echo JText::_('Field Ordering Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Field Ordering data.</font><br>');

			$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('department', 'Department', '3', null, '2', '1', '1', '0', '1');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('gender', 'Gender', '7', null, '2', '1', '1', '0', '0');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('age', 'Age', '8', null, '2', '1', '1', '0', '0');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('careerlevel', 'Career Level', '15', null, '2', '1', '1', '0', '0');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('workpermit', 'Work Permit', '16', null, '2', '1', '1', '0', '0');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('requiredtravel', 'Required Travel', '17', null, '2', '1', '1', '0', '0');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('video', 'Video', '18', null, '2', '1', '1', '0', '0');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('map', 'Map', '19', null, '2', '1', '1', '0', '1');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('sendmeresume', 'Send me Resume', '28', null, '2', '1', '1', '0', '0');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('agreement', 'Agreement', '32', null, '2', '1', '1', '0', '1');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('metadescription', 'Meta Description', '33', null, '2', '1', '1', '0', '1');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('metakeywords', 'Meta Keywords', '34', null, '2', '1', '1', '0', '1');";
			$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." (field,fieldtitle,ordering,section,fieldfor,published,sys,cannotunpublish,required) VALUES ('searchable', 'Searchable', '12', '10', '3', '1', '1', '0', '0');";
            $db->setQuery($sql);
            if ( $result = $db->queryBatch()) echo JText::_('New Field Ordering installed successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to install new Field Ordering data.</font><br>');


            $db->setQuery($filtersquery);
            if ( $result = $db->queryBatch()) echo JText::_('Filters Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Filters data.</font><br>');

            $db->setQuery($educationquery);
            if ( $result = $db->queryBatch()) echo JText::_('Heighest Education Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Heighest Education data.</font><br>');

            $db->setQuery($resumesearchquery);
            if ( $result = $db->queryBatch()) echo JText::_('Resume Searches Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Resume Searches data.</font><br>');

            $db->setQuery($rolesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Roles Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Roles data.</font><br>');

            $db->setQuery($userfieldsquery);
            if ( $result = $db->queryBatch()) echo JText::_('User Fields Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up User Fields data.</font><br>');

            $db->setQuery($userfieldvaluequery);
            if ( $result = $db->queryBatch()) echo JText::_('User Field Values Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up User Field Values data.</font><br>');

            $db->setQuery($userfielddataquery);
            if ( $result = $db->queryBatch()) echo JText::_('User Field Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up User Field data.</font><br>');

            $db->setQuery($userrolesquery);
            if ( $result = $db->queryBatch()) echo JText::_('User Roles Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up User Roles data.</font><br>');


            $db->setQuery($countriesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Countries Retrieved backed up data successfully!<br>');
            else echo JText::_('Error occurred while attempting to transfer backed up Countries data.<br>');

            $db->setQuery($statesquery);
            if ( $result = $db->queryBatch())	echo JText::_('States Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up States data.</font><br>');

            $db->setQuery($countiesquery);
            if ( $result = $db->queryBatch())	echo JText::_('Counties Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Counties data.</font><br>');

            $db->setQuery($citiesquery);
            if ( $result = $db->queryBatch()) echo JText::_('Cities Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Cities data.</font><br>');

            $db->setQuery($zipsquery);
            if ( $result = $db->queryBatch())	echo JText::_('Zips Retrieved backed up data successfully!<br>');
            else echo "<font color='red'>".JText::_('Error occurred while attempting to transfer backed up Zips data.</font><br>');

			$db->setQuery($currenciesquery);
			if (! $result = $db->queryBatch()) "<font color='red'>".JText::_('Error occurred while attempting to inserting default Currencies.</font><br>');

  			$db->setQuery('UPDATE '.$db->nameQuote('#__wrecruit_jobs').' SET currencyid = 1');
			if (! $result = $db->query()) "<font color='red'>".JText::_('Error occurred while attempting to Job default Currencies.</font><br>');

          $clquery = setupSQLTransferCleanup();
            //echo '<br> clean '.$clquery;
            $db->setQuery($clquery);
            $db->queryBatch();

}



function setupSQLTransferCleanup()
{
	$db = &JFactory::getDBO();
	$sql = 'DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_ages_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_careerlevels_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_experiences_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_departments_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_shortlistcandidates_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_employerpackages_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_employerpaymenthistory_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_jobseekerpackages_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_jobseekerpaymenthistory_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_goldcompanies_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_goldjobs_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_goldresumes_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_featuredcompanies_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_featuredjobs_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_featuredresumes_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_salaryrangetypes_bak').';';
//	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_jobs_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_categories_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_salaryrange_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_jobapply_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_userallow_bak').';';
//	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_resume_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_countries_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_states_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_counties_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_cities_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_zips_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_config_bak').';';

	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_companies_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_jobsearches_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_jobstatus_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_jobtypes_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_shifts_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_coverletters_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_emailtemplates_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_fieldsordering_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_filters_bak').';';

	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_heighesteducation_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_resumesearches_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_roles_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_userfields_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_userfieldvalues_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_userfield_data_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_userroles_bak').';';
	
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_folderresumes_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_folders_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_jobalertsetting_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_messages_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_resumerating_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_subcategories_bak').';';
	$sql .= ' DROP TABLE IF EXISTS '.$db->nameQuote('#__wrecruit_currencies_bak').';';
	return $sql;
}





function getDefaultConfigSQL() {
	$db = &JFactory::getDBO();

    $sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('companyautoapprove','1','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('comp_city','1','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('comp_county','1','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('comp_editor','1','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('comp_state','1','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('comp_zipcode','1','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('currency','$','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('cur_location','1','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('defaultcountry','PK','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('defaultempallow','1','defaultallow');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('defaultjoballow','0','defaultallow');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('empautoapprove','0','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('employerdefaultrole','1','notuse');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jobautoapprove','0','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jobseekerdefaultrole','2','notuse');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('job_editor','1','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('mailfromaddress','sender@joomshark.com','email');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('mailfromname','WRecruit','email');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('newdays','7','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeaddress','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeeducation','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeedu_gradeschool','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeedu_highschool','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeedu_otherchool','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeedu_university','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeemployer','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeem_1','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeem_2','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeem_3','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeem_recent','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumereference','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumereference1','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumereference2','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumereference3','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeskill','1','resume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_durration','1','searchjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_experience','1','searchjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_heighesteducation','1','searchjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_salaryrange','1','searchjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_shift','1','searchjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_showsave','1','searchjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_startpublishing','1','searchjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_stoppublishing','1','searchjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_companysite','1','searchjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_available','1','searchresume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_experience','1','searchresume');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('actk', '0','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_gender','1','searchresume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_heighesteducation','1','searchresume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_name','1','searchresume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_nationality','1','searchresume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_salaryrange','1','searchresume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_showsave','1','searchresume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_title','1','searchresume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('showemployerlink','1','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('theme','wrecruit01.css','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('title','WRECRUIT','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('data_directory', 'wrecruitdata', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('version','1.0.7.7',NULL);";
 	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('versioncode', '1077',NULL);";
 	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('versiontype', 'business',NULL);";
 	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_address', '1','default');";
 	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('refercode', '0','default');";
 	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_address_fields_width', '130','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_category', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_jobtype', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_heighesteducation', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_salaryrange', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('fr_cr_txa', '','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('fr_cr_txsh', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('fr_cr_txb', '','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('backuponuninstall', '1',NULL);";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('company_logofilezize', '50','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resume_photofilesize', '50','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('offline', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('offline_text', 'WRecruit is down for maintenance.<br /> Please check back again soon.','default');";

  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_multicompanies','0','payment');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_title','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_category','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_jobtype','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_jobstatus','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_company','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_companysite','0','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_country','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_state','0','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_county','0','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_city','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_salary','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_created','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_noofjobs','1','listjob');";

  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_title','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_category','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_jobtype','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_jobstatus','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_company','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_companysite','0','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_country','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_state','0','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_county','0','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_city','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_salary','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_created','1','listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_noofjobs','1','listjob');";
	
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_js_controlpanel', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_js_packages', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_js_viewpackage', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_wrecruitcat', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_js_listjob', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_js_newestjobs', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_wrecruitsearch', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_wrecruitsearchresult', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_js_viewresume', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_conrolpanel', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_packages', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_viewpackage', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_resumesearch', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_resumesearchresult', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_viewcompany', '1','default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_viewjob', '1','default');";

  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_keyword','1','searchjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_category','1','searchjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_type','1','searchjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_status','1','searchjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_company','1','searchjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_country','1','searchjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_state','1','searchjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_county','1','searchjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_city','1','searchjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_zipcode','0','searchjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_category','1','searchresume');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_type','1','searchresume');";

    $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('featuredjob_autoapprove', '1', 'featuredjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('goldjob_autoapprove', '1', 'goldjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('featuredcompany_autoapprove', '1', 'featuredcompany');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('goldcompany_autoapprove', '1', 'goldcompany');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('featuredresume_autoapprove', '1', 'featuredresume');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('goldresume_autoapprove', '1', 'goldresume');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_method', '', 'payment');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_shopingurl', '', 'payment');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_successefulurl', '', 'payment');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_cancelurl', '', 'payment');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_paypalaccount', '', 'payment');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_showdescription', '1', 'payment');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_description', 'Description', 'payment');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_showfooter', '1', 'payment');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_currency', 'USD', 'payment');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_authtoken', '', 'payment');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_test_mode', '0', 'payment');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('employer_defaultpackage', '1', 'package');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jobseeker_defaultpackage', '1', 'package');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('date_format', 'd-m-Y', 'default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('adminemailaddress', '', 'email');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('email_admin_new_company', '1', 'email');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('email_admin_new_job', '1', 'email');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('email_admin_new_resume', '1', 'email');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('email_admin_job_apply', '1', 'email');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('email_admin_new_department', '1', 'email');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('email_admin_employer_package_purchase', '1', 'email');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('email_admin_jobseeker_package_purchase', '1', 'email');";
  	
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('onlyonce_employer_getfreepackage', '1', 'package');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('onlyonce_jobseeker_getfreepackage', '1', 'package');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('employer_freepackage_autoapprove', '1', 'package');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jobseeker_freepackage_autoapprove', '1', 'package');";
  	
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('subcategories', '1', 'listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('subcategories_all', '1', 'listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('subcategories_colsperrow', '3', 'listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('subcategoeis_max_hight', '250', 'listjob');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('categories_colsperrow', '3', 'default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('message_auto_approve', '1', 'messages');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('conflict_message_auto_approve', '0', 'messages');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('overwrite_jobalert_settings', '1', 'default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_can_apply_to_job', '0', 'default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_show_login_message', '1', 'default');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('folder_auto_approve', '1', 'folder');";
  	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('department_auto_approve', '1', 'department');";

	
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('formcompany', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('mycompanies', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('formjob', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('myjobs', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('formdepartment', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('mydepartment', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('empmessages', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('alljobsappliedapplications', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumesearch', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('my_resumesearches', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('packages', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('purchasehistory', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('my_stats', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('myfolders', '1', 'emcontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('formresume', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('myresumes', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('formcoverletter', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('mycoverletters', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jspackages', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jspurchasehistory', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jobalertsetting', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jobcat', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('listnewestjobs', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('myappliedjobs', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jobsearch', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('my_jobsearches', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jsmy_stats', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jsmessages', '1', 'jscontrolpanel');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emcontrolpanel', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emnewcompany', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emnewjob', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emmyjobs', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emmycompanies', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emappliedresume', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emnewdepartment', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emnewfolder', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jscontrolpanel', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jsjobcategory', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jssearchjob', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jsnewestjob', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jsmyresume', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jsaddresume', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('login_redirect', '', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jsaddcoverletter', '1', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('hidecountry', '0', 'default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jobalert_auto_approve', '1', 'jobalert');";

	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('pagseguro_email', '1', 'payment');";

	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_description','1','listjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_description','1','listjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_shortdescriptionlenght','200','listjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_joblistingstyle','july2011','listjob');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_style','july2011','searchresume');";
	
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_address_country','1','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_address_state','1','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_address_county','200','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_address_city','july2011','default');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('testing_mode','1','default');";
 	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resume_style','tabular','default');";
 	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('api_primary','a2d09c7d76fced01f8be4b1f4cce8bec','api');";
 	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('api_secondary','','api');";
 	
       return $sql;
}
function getUpdateConfigSQL() {
	$db = &JFactory::getDBO();

    $sql = "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('companyautoapprove','1','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('comp_city','1','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('comp_county','1','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('comp_editor','1','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('empautoapprove','0','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('employerdefaultrole','1','notuse');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jobautoapprove','0','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jobseekerdefaultrole','2','notuse');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('job_editor','1','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('mailfromaddress','sender@joomshark.com','email');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('mailfromname','WRecruit','email');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('newdays','7','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeedu_university','1','resume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeemployer','1','resume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeem_1','1','resume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeem_2','1','resume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeem_3','1','resume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumeem_recent','1','resume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resumereference','1','resume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_durration','1','searchjob');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_experience','1','searchjob');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_heighesteducation','1','searchjob');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_salaryrange','1','searchjob');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_shift','1','searchjob');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_showsave','1','searchjob');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_startpublishing','1','searchjob');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_job_stoppublishing','1','searchjob');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_experience','1','searchresume');";
  	$sql .= "REPLACE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('actk', '0','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_gender','1','searchresume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_heighesteducation','1','searchresume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_name','1','searchresume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_nationality','1','searchresume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_salaryrange','1','searchresume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_showsave','1','searchresume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_title','1','searchresume');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('showemployerlink','1','default');";
	$sql .= "REPLACE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('version','1.0.7.7',NULL);";
 	$sql .= "REPLACE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('versioncode', '1077',NULL);";
 	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('versiontype', 'business',NULL);";
 	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_address', '1','default');";
 	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('refercode', '0','default');";
 	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_address_fields_width', '130','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_category', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_jobtype', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_heighesteducation', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_salaryrange', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter', '1','default');";
  	$sql .= "REPLACE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('fr_cr_txa', '','default');";
  	$sql .= "REPLACE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('fr_cr_txsh', '1','default');";
  	$sql .= "REPLACE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('fr_cr_txb', '','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('backuponuninstall', '1',NULL);";
  	$sql .= "REPLACE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('offline', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('offline_text', 'WRecruit is down for maintenance.<br /> Please check back again soon.','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('payment_multicompanies','0','payment');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_title','1','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_category','1','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('adminemailaddress', '', 'email');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('onlyonce_employer_getfreepackage', '1', 'package');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('onlyonce_jobseeker_getfreepackage', '1', 'package');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('employer_freepackage_autoapprove', '1', 'package');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jobseeker_freepackage_autoapprove', '1', 'package');";
  	
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('subcategories', '1', 'listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('subcategories_all', '1', 'listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('subcategories_colsperrow', '3', 'listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('subcategoeis_max_hight', '250', 'listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('categories_colsperrow', '3', 'default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('message_auto_approve', '1', 'messages');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('conflict_message_auto_approve', '0', 'messages');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('overwrite_jobalert_settings', '1', 'default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_can_apply_to_job', '0', 'default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_show_login_message', '1', 'default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('folder_auto_approve', '1', 'folder');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('department_auto_approve', '1', 'department');";
  	
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_title','1','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_category','1','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_jobtype','1','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_jobstatus','1','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_company','1','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_companysite','0','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_country','1','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_state','0','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_county','0','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_city','1','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_salary','1','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_created','1','listjob');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_noofjobs','1','listjob');";
	
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_js_controlpanel', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_js_packages', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_js_viewpackage', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_wrecruitcat', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_js_listjob', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_js_newestjobs', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_wrecruitsearch', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_wrecruitsearchresult', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_js_viewresume', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_conrolpanel', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_packages', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_viewpackage', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_resumesearch', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_resumesearchresult', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_viewcompany', '1','default');";
  	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitorview_emp_viewjob', '1','default');";

	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('formcompany', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('mycompanies', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('formjob', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('myjobs', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('formdepartment', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('mydepartment', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('empmessages', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('alljobsappliedapplications', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('resumesearch', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('my_resumesearches', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('packages', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('purchasehistory', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('my_stats', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('myfolders', '1', 'emcontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('formresume', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('myresumes', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('formcoverletter', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('mycoverletters', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('jspackages', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('jspurchasehistory', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('jobalertsetting', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('jobcat', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('listnewestjobs', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('myappliedjobs', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('jobsearch', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('my_jobsearches', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('jsmy_stats', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('jsmessages', '1', 'jscontrolpanel');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emcontrolpanel', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emnewcompany', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emnewjob', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emmyjobs', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emmycompanies', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emappliedresume', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emnewdepartment', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_emnewfolder', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jscontrolpanel', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jsjobcategory', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jssearchjob', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jsnewestjob', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jsmyresume', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jsaddresume', '1', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('login_redirect', '', 'default');";
	$sql .= "INSERT IGNORE INTO".$db->nameQuote('#__wrecruit_config')." VALUES ('tmenu_jsaddcoverletter', '1', 'default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('hidecountry', '0', 'default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('jobalert_auto_approve', '1', 'jobalert');";

	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('pagseguro_email', '1', 'payment');";

	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_description','1','listjob');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('visitor_lj_description','1','listjob');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_shortdescriptionlenght','200','listjob');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('lj_joblistingstyle','july2011','listjob');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('search_resume_style','july2011','searchresume');";

	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_address_country','1','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_address_state','1','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_address_county','200','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('filter_address_city','july2011','default');";
	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('testing_mode','1','default');";
 	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('resume_style','tabular','default');";
 	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('api_primary','a2d09c7d76fced01f8be4b1f4cce8bec','api');";
 	$sql .= "INSERT IGNORE INTO ".$db->nameQuote('#__wrecruit_config')." VALUES ('api_secondary','','api');";

	return $sql;

}

function getDefaultCatSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Accounting/Finance');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Administrative');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Advertising');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Airlines/Avionics/Aerospace');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Architectural');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Automotive');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Banking/Finance');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Biotechnology');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Civil/Construction');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Engineering');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Cleared Jobs');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Communications');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Computer/IT');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Construction');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Consultant/Contractual');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Customer Service');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Defense');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Design');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Education');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Electrical Engineering');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Electronics Engineering');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Energy');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Engineering');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Environmental/Safety');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Fundraising');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Health/Medicine');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Homeland Security');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Human Resources');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Insurance');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Intelligence Jobs');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Internships/Trainees');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Legal');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Logistics/Transportation');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Maintenance');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Management');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Manufacturing/Warehouse');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Marketing');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Materials Management');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Mechanical Engineering');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Mortgage/Real Estate');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('National Security');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Part-time/Freelance');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Printing');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Product Design');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Public Relations');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Public Safety');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Research');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Retail');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Sales');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Scientific');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Shipping/Distribution');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Technicians');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Trades');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Transportation');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Transportation Engineering');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_categories')." (cat_title) VALUES ('Web Site Development');";
	return $sql;
}

function getDefaultSubCatSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('Accounting/Finance');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('Administrative');";
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('1', 'Cast Accounting ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('1', 'Controllership & Accounting Managment', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('1', 'Payroll ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('1', 'Corporate Finance', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('2', 'Administrative Division', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('2', 'Autonomous Territories', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('2', 'Administrative County', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('2', 'Administrative Communes', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('3', 'Finance Advertising ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('3', 'Advertising-Tourism', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('3', 'Advertising Social Net', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('3', 'Distributor Marketing', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('3', 'Facebook Advertising', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('4', 'Quality Engineer ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('4', 'Office Assistant ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('4', 'Air Host/hostess', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('4', 'Ticketing/reservation', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('5', 'Architectural Drafting', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('5', 'Enterprize Architecture', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('5', 'Architecture Frameworks', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('6', 'Automotive Design', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('6', 'Autmotive Paints', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('6', 'Automotive Equipment/Parts', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('6', 'Automotive Search Engine', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('7', 'Private Banking', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('7', 'Stock Brocker', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('7', 'Fractional-reserve Banking', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('7', 'Mobile Banking', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('8', 'Plant Biotechnology', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('8', 'Animal Biotechnology', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('8', 'Biotechnology & Medicine', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('8', 'Biotechnology & Society', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('8', 'Industrail & Microbial Biotechnonogy', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('9', 'Construction (Design & Managment)', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('9', 'Construction Engineering ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('9', 'Composite Construction', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('10', 'Civil Engineering', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('10', 'Software Engineering', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('10', 'Nuclear Engineering', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('10', 'Ocean Engingeering', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('10', 'Transpotation Engineering', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('11', 'Security Cleared Jobs', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('11', 'Security Cleared IT Jobs', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('11', 'Confidential & Secret Security Clearance Job', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('12', 'Verbal', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('12', 'E-mail', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('12', 'Non-verbal', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('13', 'Computer Consulting Services ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('13', 'Computer Installations Services', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('13', 'Software Vendors', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('14', 'Renovaiton', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('14', 'Addition', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('14', 'New Construction', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('15', 'Organization Development', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('15', 'Construction Management', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('15', 'Managment Consulting ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('16', 'High Touch Customer Service ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('16', 'Low Touch Customer Service', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('16', 'Bad Touch Customer Service', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('17', 'By Using legal services for the poor', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('17', 'By Using Retained Counsel', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('17', 'By Self-representation', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('18', 'Project Subtype Design', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('18', 'Graphic Design', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('18', 'Interior Desing', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('19', 'IT or Engineering Education', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('19', 'Commerce & Managment', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('19', 'Medical Education', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('20', 'Power Engineering', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('20', 'Instrumentation', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('20', 'Telecommunication', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('20', 'Signal Processing', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('21', 'Electromagnetics', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('21', 'Network Analysis', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('21', 'Control Systems', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('22', 'Thermal Energy', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('22', 'Chemical Energy', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('22', 'Electrical Energy', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('22', 'Nuclear Energy', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('23', 'Software Engineering ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('23', 'Civil Engineering ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('23', 'Nuclear Engineering', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('24', 'Nuclear Safety', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('24', 'Agriculture Safety', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('24', 'Occupational Health Safety', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('25', 'Unique Fundraisers', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('25', 'Sports Fundraiserse', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('25', 'Fundraisers', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('26', 'Staying Informed', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('26', 'Medical Edcuation ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('26', 'Managing a partucular disease', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('27', 'Customs & Border Protection', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('27', 'Federal Law & Enforcement', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('27', 'Nation Protection', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('28', 'Benefits Administrators', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('28', 'Executive Compensation Analysts', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('28', 'Managment Analysts', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('29', 'Health Insurance ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('29', 'Life Insurance', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('29', 'Vehicle Insurance', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('30', 'Artificial Intelligence ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('30', 'Predictive Analytics ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('30', 'Science & Technology', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('31', 'Work Experience internship', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('31', 'Research internship', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('31', 'Sales & Marketing Intern', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('32', 'According To Law', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('32', 'Defined Rule', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('33', 'Shipping ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('33', 'Transpotation Managment', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('33', 'Third-party Logistics Provider', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('34', 'General Maintenance', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('34', 'Automobile Maintenance ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('34', 'Equipment Manitenance', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('35', 'Project Managment', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('35', 'Planning ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('35', 'Risk Managment', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('36', 'Quality Assurance ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('36', 'Product Manager', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('36', 'Planning Supervisor ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('37', 'Networking ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('37', 'Direct Mail Marketing', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('37', 'Media Advertising ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('38', 'Supply Chain ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('38', 'Hazardous Materials Management', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('38', 'Materials Inventory Managment', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('39', 'Aerospace ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('39', 'Automotive ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('39', 'Biomedical', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('39', 'Mechanical', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('39', 'Naval', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('40', 'Conventional Mortgage', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('40', 'Adjustable Rate Mortgage', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('40', 'Commercial Mortgages', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('41', 'Economic Security', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('41', 'Environmental Security', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('41', 'Military Security', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('42', 'Freelance Portfolios', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('42', 'Freelance Freedom ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('42', 'Freelance Jobs', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('43', 'Offset Lithographp ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('43', 'Themography Raised Printing', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('43', 'Digital Printing ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('44', 'idea Generation', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('44', 'Need Based Generation', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('44', 'Design Solution', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('45', 'Media Relations', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('45', 'Media Tours ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('45', 'Newsletters ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('46', 'Automised Security', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('46', 'Environmental & Social Safety', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('47', 'Basic Research', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('47', 'Applied Research', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('47', 'Methods & Appraches ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('48', 'Department Stores', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('48', 'Discount Stores', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('48', 'Supermarkets', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('49', 'Sales Contracts ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('49', 'Sales Forecasts ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('49', 'Sales Managment', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('50', 'Scientific Managment', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('50', 'Scientific Research', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('50', 'Scientific invenctions ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('51', 'Shppping/Distrubution Companies', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('51', 'Services ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('51', 'Channels & Softwares', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('52', 'Medical Technicians ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('52', 'Electrical Technicians', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('52', 'Accounting Technicians ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('53', 'Construction Trade ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('53', 'Stock Trade', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('53', 'skilled Trade ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('53', 'Option Trade ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('54', 'Transpotation System', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('54', 'Human-Powered ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('54', 'Airline,Train,bus,car', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('55', 'Subway & Civil', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('55', 'Traffic Highway Transpotation', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('56', 'Small Business ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('56', 'E-Commerce Sites ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('56', 'Portals ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('56', 'Search Engines ', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_subcategories')." (categoryid,title,status) VALUES ('56', 'Personal,Commercial,Govt', '1');";
	return $sql;
}

function getDefaultSalaryRangeSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('1000', '1500');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('1500', '2000');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('2000', '2500');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('2500', '3000');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('3000', '3500');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('3500', '4000');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('4000', '4500');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('4500', '5000');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('5000', '5500');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('5500', '6000');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('6000', '7000');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('7000', '8000');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('8000', '9000');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('9000', '10000');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrange')." (rangestart, rangeend) VALUES ('10000', '10000+');";
	return $sql;
}

function getDefaultSalaryRangeTypesSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrangetypes')." (title, status) VALUES ('Per Year', 1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrangetypes')." (title, status) VALUES ('Per Month', 1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrangetypes')." (title, status) VALUES ('Per Week', 1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_salaryrangetypes')." (title, status) VALUES ('Per Date', 1);";
	return $sql;
}

function getDefaultHeighestEducationSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_heighesteducation')." VALUES (1,'University','1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_heighesteducation')." VALUES (2,'College','1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_heighesteducation')." VALUES (3,'High School','1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_heighesteducation')." VALUES (4,'No School','1');";
	return $sql;
}

function getDefaultJobStatusSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_jobstatus')." VALUES (1,'Sourcing','1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_jobstatus')." VALUES (2,'Interviewing','1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_jobstatus')." VALUES (3,'Closed to New Applicants','1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_jobstatus')." VALUES (4,'Finalists Identified','1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_jobstatus')." VALUES (5,'Pending Approval','1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_jobstatus')." VALUES (6,'Hold','1');";
	return $sql;
}

function getDefaultJobTypeSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_jobtypes')." VALUES (1,'Full-Time','1','0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_jobtypes')." VALUES (2,'Part-Time','1','0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_jobtypes')." VALUES (3,'Internship','1','0');";
	return $sql;
}

function getDefaultShiftSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_shifts')." VALUES (1,'Morning','1','0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_shifts')." VALUES (2,'Evening','1','0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_shifts')." VALUES (3,'8 PM to 4 AM','1','0');";
	return $sql;
}
/*
function getDefaultShiftSQL() {//may remove it
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_roles')." VALUES (1,'Employer',1,-1,-1,-1,-1,-1,-1,-1,-1,1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_roles')." VALUES (2,'Job Seeker',2,-1,-1,-1,-1,-1,-1,-1,-1,1);";
	return $sql;
}
*/
function getDefaultRoleSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_roles')." VALUES (1,'Employer',1,-1,-1,-1,-1,-1,-1,-1,-1,1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_roles')." VALUES (2,'Job Seeker',2,-1,-1,-1,-1,-1,-1,-1,-1,1);";
	return $sql;
}

function getDefaultCurrenciesSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_currencies')." VALUES (1,'Pakistani Rupee','Rs.',1,1);";
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_currencies')." VALUES (1,'USD','$',1,0);";
	return $sql;
}
function getDefaultCurrenciesForUpdateSQL() {
	
	$db = &JFactory::getDBO();
	$query = 'SELECT * FROM '.$db->nameQuote('#__wrecruit_config_bak').' WHERE configname = "currency"';
	$db->setQuery($query);
	$defaultcurrency = $db->loadObject();
	if(isset($defaultcurrency)){
		$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_currencies')." VALUES (1,'Default','".$defaultcurrency->configvalue."',1,1);";
	}else{
		$sql = getDefaultCurrenciesSQL();
	}	
	return $sql;
}
function getDefaultEmailTemplatesSQL() {
	$db = &JFactory::getDBO();
	$siteAddress='';
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (1,0,'company-approval',NULL,'Company {COMPANY_NAME} has been approved','<p>Dear  {EMPLOYER_NAME} , <br /><br />Your company <strong>{COMPANY_NAME}</strong> has been approved.</p><p> Login and view detail at www.wrecruit.com  <br /><br />Please do not respond to this message. It is automatically generated and is for information purposes only. </p>',1,'2009-08-17 18:08:41');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (2,0,'company-rejecting',NULL,'Your Company {COMPANY_NAME} has been rejected','<p>Dear  {EMPLOYER_NAME} , </p><p>Your company<strong> {COMPANY_NAME}</strong> has been rejected. </p><p>Login and view detail at www.wrecruit.com  </p><p>Please do not respond to this message. It is automatically generated and is for information purposes only. </p>',NULL,'2009-08-17 17:54:48');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (4,0,'job-approval',NULL,'Your job {JOB_TITLE} has been approved.','<p>Dear {EMPLOYER_NAME} , </p><p>Your job <strong>{JOB_TITLE}</strong> has been approved.</p><p> Login and view detail at $siteAddress </p><p>Please do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-17 22:10:27');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (5,0,'job-rejecting',NULL,'Your job {JOB_TITLE} has been rejected.','<p>Dear {EMPLOYER_NAME} , </p><p>Your job <strong>{JOB_TITLE}</strong> has been rejected.</p><p> Login and view detail at $siteAddress </p><p>Please do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-17 22:12:43');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (6,0,'resume-approval',NULL,'Your resume {RESUME_TITLE} has been approval.','<p>Dear {JOBSEEKER_NAME}  , </p><p> Your resume <strong>{RESUME_TITLE}</strong>  has been approval.</p><p> Login and view detail at $siteAddress </p><p>Please do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-17 22:15:12');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (7,0,'resume-rejecting',NULL,'Your company {RESUME_TITLE} has been rejected. ','<p>Dear {JOBSEEKER_NAME}  , </p><p> Your resume <strong>{RESUME_TITLE}</strong>  has been rejected.</p><p> Login and view detail at $siteAddress </p><p>Please do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-17 22:14:52');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (8,0,'jobapply-jobapply',NULL,'WRecruit :  {JOBSEEKER_NAME} apply for {JOB_TITLE}','<p>Hello {EMPLOYER_NAME} , </p><p> Mr/Mrs {JOBSEEKER_NAME} apply for {JOB_TITLE}.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (9,0,'company-new',NULL,'WRecruit : New Company {COMPANY_NAME} has beed received','<p>Hello Admin , </p><p> We receive new company.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (10,0,'job-new',NULL,'WRecruit : New Job {JOB_TITLE} has beed received','<p>Hello Admin , </p><p> We receive new job.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (11,0,'resume-new',NULL,'WRecruit :  New resume {RESUME_TITLE} has beed received','<p>Hello Admin , </p><p> We receive new resume.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (12,0,'department-new',NULL,'WRecruit : New Department {DEPARTMENT_NAME} {COMPANY_NAME} has beed received','<p>Hello Admin , </p><p> We receive new department.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (13,0,'employer-buypackage',NULL,'WRecruit : Employer Buy Package {PACKAGE_NAME}','<p>Hello Admin , </p><p> Employer buy a package.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (14,0,'jobseeker-buypackage',NULL,'WRecruit : Jobseeker Buy Package {PACKAGE_NAME}','<p>Hello Admin , </p><p> Job Seeker buy package.</p><p> Login and view detail at $siteAddress \\n\\nPlease do not respond to this message. It is automatically generated and is for information purposes only.</p>',NULL,'2009-08-18 16:46:16');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (15,'0','message-email', null, 'WRecruit: New Message Alert', '<p>Dear {NAME},</p>\r\n<p>{SENDER_NAME}: send you new message.</p>\r\n<p><strong><span style=\"text-decoration: underline;\">Summary</span></strong></p>\r\n<p>Company Name: {COMPANY_NAME}</p>\r\n<p>Job Title: {JOB_TITLE}</p>\r\n<p>Resume Title: {RESUME_TITLE}</p>', '1', '2009-08-18 16:46:16');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_emailtemplates')." VALUES (16,0,'job-alert',NULL,'WRecruit: New Job','<p>Dear Job Seekers , </p><p> We receive new job.</p><p> Title: {JOB_TITLE}</p><p> Category: {CATEGORY}</p><p> Sub category: {SUB_CATEGORY}</p><p> Location: {LOCATION}</p><p> Login and view detail at  Please do not respond to this message. It is automatically generated and is for information purposes only.</p>	',NULL,'2011-03-31 16:46:16');";
	return $sql;
}

function getDefaultAgesSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_ages')." VALUES (1,'10 Years',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_ages')." VALUES (2,'15 Years',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_ages')." VALUES (3,'20 Years',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_ages')." VALUES (4,'25 Years',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_ages')." VALUES (5,'30 Years',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_ages')." VALUES (6,'35 Years',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_ages')." VALUES (7,'40 Years',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_ages')." VALUES (8,'45 Years',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_ages')." VALUES (9,'50 Years',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_ages')." VALUES (10,'55 Years',1);";
	return $sql;
}

function getDefaultCareerLevelsSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_careerlevels')." VALUES (1,'Student (Undergraduate)',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_careerlevels')." VALUES (2,'Student (Graduate)',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_careerlevels')." VALUES (3,'Entry Level',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_careerlevels')." VALUES (4,'Experienced (Non-Manager)',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_careerlevels')." VALUES (5,'Manager',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_careerlevels')." VALUES (6,'Executive (Department Head, SVP, VP etc)',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_careerlevels')." VALUES (7,'Senior Executive (President, CEO, etc)',1);";
	return $sql;
}

function getDefaultExperiencesSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (1,'Fresh',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (2,'Less then 1 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (3,'1 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (4,'2 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (5,'3 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (6,'4 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (7,'5 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (8,'6 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (9,'7 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (10,'8 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (11,'9 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (12,'10 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (13,'11 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (14,'12 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (15,'13 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (16,'14 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (17,'15 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (18,'16 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (19,'17 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (20,'18 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (21,'19 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (22,'20 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (23,'21 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (24,'22 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (25,'23 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (26,'24 Year',1);";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_experiences')." VALUES (27,'25 Year',1);";
	return $sql;
}

function getDefaultEmployerPackagesSQL() {
	$db = &JFactory::getDBO();
        $sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_employerpackages')." VALUES(1,'Free Package',0,0,	0,	'',	'2010-06-01 11:53:05','2010-08-24 00:00:00',1,	3,5,0,0,0,0,CURDATE(),0,0,1,'Free Package for single company','Free Package for single company',1,1,1,60,0,0,0,0,1,30,1,'','',0,1);";
	return $sql;
}

function getDefaultJobSeekerPackagesSQL() {
	$db = &JFactory::getDBO();
        $sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_jobseekerpackages')." VALUES(1,'Free Package',0,0,1,'','2010-06-01 11:53:05','2010-08-24 00:00:00',1,3,-1,1,1,0,0,0,60,'Free Package','Free Package',1,CURDATE(),0,0,'','',1);";
	return $sql;
}

function getDefaultContriesSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (3,'AF','BF','Burkina Faso','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (5,'AF','CM','Cameroon','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (6,'AF','CV','Cape Verde','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (7,'AF','CF','Central African Republic','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (8,'AF','TD','Chad','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (9,'AF','KM','Comoros','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (10,'AF','CG','Congo','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (12,'AF','BJ','Benin','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (14,'AF','BI','Burundi','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (21,'AF','CI','Cote D\Ivorie','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (22,'AF','DJ','Djibouti','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (23,'AF','GQ','Equatorial Guinea','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (24,'AF','ER','Eritrea','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (25,'AF','ET','Ethiopia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (26,'AF','EG','Egypt','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (27,'AF','GA','Gabon','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (28,'AF','GH','Ghana','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (29,'AF','GN','Guinea','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (30,'AF','GM','Gambia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (31,'AF','GW','Guinea-Bissau','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (32,'AF','KE','Kenya','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (33,'AF','LS','Lesotho','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (34,'AF','LR','Liberia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (35,'AF','MG','Madagascar','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (36,'AF','ML','Mali','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (37,'AF','MR','Mauritania','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (38,'AF','YT','Mayotte','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (39,'AF','MA','Morocco','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (40,'AF','MZ','Mozambique','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (41,'AF','MW','Malawi','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (42,'AF','NA','Namibia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (43,'AF','NE','Niger','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (44,'AF','NG','Nigeria','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (45,'AF','RE','Reunion','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (46,'AF','SH','St. Helena','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (47,'AF','ST','Sao Tome and Principe','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (48,'AF','SN','Senegal','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (49,'AF','SL','Sierra Leone','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (50,'AF','SO','Somalia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (51,'AF','ZA','South Africa','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (52,'AF','SD','Sudan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (53,'AF','SZ','Swaziland','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (54,'AF','TZ','Tanzania','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (55,'AF','TG','Togo','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (56,'AF','UG','Uganda','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (57,'AF','EH','Western Sahara','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (58,'AF','ZR','Zaire','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (59,'AF','ZM','Zambia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (60,'AF','ZW','Zimbabwe','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (62,'AS','AF','Afghanistan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (63,'AS','BD','Bangladesh','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (64,'AS','BT','Bhutan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (65,'AS','BN','Brunei','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (66,'AS','KH','Cambodia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (67,'AS','CN','China','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (68,'AS','HK','Hong Kong','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (69,'AS','IN','India','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (70,'AS','ID','Indonesia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (71,'AS','JP','Japan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (72,'AS','KZ','Kazakhstan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (73,'AS','KG','Kyrgyzstan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (74,'AS','LA','Laos','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (75,'AS','MO','Macau','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (76,'AS','MY','Malaysia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (77,'AS','MV','Maldives','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (78,'AS','MN','Mongolia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (79,'AS','NP','Nepal','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (80,'AS','PK','Pakistan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (81,'AS','PH','Philippines','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (82,'AS','KR','Republic of Korea','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (83,'AS','RU','Russia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (84,'AS','SC','Seychelles','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (85,'AS','SG','Singapore','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (86,'AS','LK','Sri Lanka','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (87,'AS','TW','Taiwan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (88,'AS','TJ','Tajikistan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (89,'AS','TH','Thailand','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (90,'AS','TM','Turkmenistan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (91,'AS','UZ','Uzbekistan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (92,'AS','VN','Vietnam','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (94,'AU','AU','Australia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (95,'AU','FM','Federated States of Micronesia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (96,'AU','FJ','Fiji','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (97,'AU','PF','French Polynesia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (98,'AU','GU','Guam','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (99,'AU','KI','Kiribati','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (100,'AU','MH','Marshall Islands','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (101,'AU','NR','Nauru','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (102,'AU','NC','New Caledonia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (103,'AU','NZ','New Zealand','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (104,'AU','MP','Northern Mariana Islands','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (105,'AU','PW','Palau','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (106,'AU','PG','Papua New Guinea','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (107,'AU','PN','Pitcairn','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (108,'AU','SB','Solomon Islands','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (109,'AU','TO','Tonga','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (110,'AU','TV','Tuvalu','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (111,'AU','VU','Vanuatu','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (112,'CA','AI','Anguilla','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (114,'CA','AW','Aruba','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (115,'CA','BS','Bahamas','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (116,'CA','BB','Barbados','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (117,'CA','BM','Bermuda','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (118,'CA','VI','British Virgin Islands','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (119,'CA','KY','Cayman Islands','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (120,'CA','DM','Dominica','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (121,'CA','DO','Dominican Republic','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (122,'CA','GD','Grenada','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (123,'CA','GP','Guadeloupe','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (124,'CA','HT','Haiti','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (125,'CA','JM','Jamaica','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (126,'CA','MQ','Martinique','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (127,'CA','AN','Neterlands Antilles','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (128,'CA','PR','Puerto Rico','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (129,'CA','KN','St. Kitts and Nevis','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (130,'CA','LC','St. Lucia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (131,'CA','VC','St. Vincent and the Grenadines','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (132,'CA','TT','Trinidad and Tobago','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (133,'CA','TC','Turks and Caicos Islands','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (134,'CE','BZ','Belize','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (135,'CE','CR','Costa Rica','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (136,'CE','SV','El Salvador','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (137,'CE','GT','Guatemala','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (138,'CE','HN','Honduras','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (139,'CE','NI','Nicaragua','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (140,'CE','PA','Panama','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (143,'CE','AM','Armenia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (144,'CE','AT','Austria','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (145,'CE','AZ','Azerbaijan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (146,'CE','BY','Belarus','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (147,'CE','BE','Belgium','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (148,'CE','BG','Bulgaria','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (149,'CE','HR','Croatia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (150,'CE','CY','Cyprus','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (151,'CE','CZ','Czech Republic','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (152,'CE','DK','Denmark','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (153,'CE','EE','Estonia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (154,'CE','FO','Faroe Islands','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (155,'CE','FI','Finland','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (156,'CE','FR','France','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (157,'CE','GE','Georgia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (158,'CE','DE','Germany','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (159,'CE','GI','Gibraltar','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (160,'CE','GR','Greece','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (161,'CE','GL','Greenland','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (162,'CE','HU','Hungary','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (163,'CE','IS','Iceland','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (164,'CE','IE','Ireland','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (165,'CE','IT','Italy','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (166,'CE','LV','Latvia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (167,'CE','LI','Liechtenstein','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (168,'CE','LT','Lithuania','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (169,'CE','LU','Luxembourg','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (170,'CE','MT','Malta','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (171,'CE','FX','Metropolitan France','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (172,'CE','MD','Moldova','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (173,'CE','NL','Netherlands','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (174,'CE','NO','Norway','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (175,'CE','PL','Poland','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (176,'CE','PT','Portugal','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (177,'CE','RO','Romania','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (178,'CE','SK','Slovakia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (179,'CE','SI','Slovenia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (180,'CE','ES','Spain','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (181,'CE','SJ','Svalbard and Jan Mayen Islands','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (182,'CE','SE','Sweden','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (183,'CE','CH','Switzerland','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (184,'CE','MK','Republic of Macedonia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (185,'CE','TR','Turkey','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (186,'CE','UA','Ukraine','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (187,'CE','GB','United Kingdom','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (188,'CE','VA','Vatican City','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (189,'CE','YU','Yugoslavia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (190,'ME','IL','Israel','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (191,'ME','JO','Jordan','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (192,'ME','KW','Kuwait','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (193,'ME','LB','Lebanon','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (194,'ME','OM','Oman','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (195,'ME','QA','Qatar','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (196,'ME','SA','Saudi Arabia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (197,'ME','SY','Syria','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (198,'ME','AE','United Arab Emirates','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (199,'ME','YE','Yemen','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (200,'NA','CA','Canada','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (201,'NA','MX','Mexico','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (202,'NA','US','United States','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (204,'SA','BO','Bolivia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (205,'SA','BR','Brazil','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (206,'SA','CL','Chile','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (207,'SA','CO','Colombia','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (208,'SA','EC','Equador','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (209,'SA','FK','Falkland Islands','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (210,'SA','GF','French Guiana','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (211,'SA','GY','Guyana','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (212,'SA','PY','Paraguay','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (213,'SA','PE','Peru','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (214,'SA','SR','Suriname','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (215,'SA','UY','Uruguay','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (216,'SA','VE','Venezuela','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (217,'OT','BH','Bahrain','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (218,'OT','BV','Bouvet Islands','Y');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_countries')." VALUES (219,'OT','IO','British Indian Ocean Territory','Y');";
	
	return $sql;
}

function getDefaultPakStatesSQL() {
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_states')." (`code`,`name`,`enabled`,`countrycode`) VALUES ('Capital','Capital','Y','PK');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_states')." (`code`,`name`,`enabled`,`countrycode`) VALUES ('Punjab','Punjab','Y','PK');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_states')." (`code`,`name`,`enabled`,`countrycode`) VALUES ('Sind','Sind','Y','PK');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_states')." (`code`,`name`,`enabled`,`countrycode`) VALUES ('NWFP','NWFP','Y','PK');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_states')." (`code`,`name`,`enabled`,`countrycode`) VALUES ('Balochstan','Balochistan','Y','PK');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_states')." (`code`,`name`,`enabled`,`countrycode`) VALUES ('AJK','Azad Jammu Kashmir','Y','PK');";
	
	return $sql;
}

function getDefaultPakCountiesSQL() {
	$db = &JFactory::getDBO();
	
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Chitral','Chitral','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('UpperDir','Upper Dir','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('LowerDir','Lower Dir','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Swat','Swat','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Shangla','Shangla','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Buner','Buner','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Malakand','Malakand P.A.','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Kohistan','Kohistan','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Mansehra','Mansehra','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Batagram','Batagram','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Abbottabad','Abbottabad','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Haripur','Haripur','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Mardan','Mardan','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Swabi','Swabi','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Charsadda','Charsadda','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Peshawar','Peshawar','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Nowshera','Nowshera','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Kohat','Kohat','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Hangu','Hangu','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Karak','Karak','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Bannu','Bannu','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('DIKhan','Dera Ismail Khan','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Tank','Tank','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('LakkiMarw','Lakki Marwat','Y','PK','NWFP');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Rawalpindi','Rawalpindi','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Jhelum','Jhelum','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Chakwal','Chakwal','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Sargodha','Sargodha','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Bhakkar','Bhakkar','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Khushab','Khushab','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Mianwali','Mianwali','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Faisalabad','Faisalabad','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Jhang','Jhang','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('TTSingh','Toba Tek Singh','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Gujranwala','Gujranwala','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Hafizabad','Hafizabad','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Gujrat','Gujrat','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('MandiBaha','Mandi Bahauddin','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Sialkot','Sialkot','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Narowal','Narowal','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Lahore','Lahore','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Kasur','Kasur','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Okara','Okara','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Sheikhupur','Sheikhupura','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Vehari','Vehari','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Sahiwal','Sahiwal','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Pakpattan','Pakpattan','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Multan','Multan','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Lodhran','Lodhran','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Khanewal','Khanewal','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('DGKhan','Dera Ghazi Khan','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Rajanpur','Rajanpur','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Layyah','Layyah','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Muzaffarga','Muzaffargarh','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Bahawalpur','Bahawalpur','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Bahawalnag','Bahawalnagar','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('RYKhan','Rahim Yar Khan','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Attock','Attock','Y','PK','Punjab');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Islamabad','Islamabad','Y','PK','Capital');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Shikarpur','Shikarpur','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Larkana','Larkana','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Sukkur','Sukkur','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Ghotki','Ghotki','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Khairpur','Khairpur','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Naushahro','Naushahro Feroze','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('NawabShah','Nawab Shah','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Dadu','Dadu','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Hyderabad','Hyderabad','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Badin','Badin','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Thatta','Thatta','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Sanghar','Sanghar','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('MirpurKha','Mirpur Khas','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Umerkot','Umerkot','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Tharparkar','Tharparkar','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Karachi','Karachi','Y','PK','Sind');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Quetta','Quetta','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Pishin','Pishin','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('KillaAbdu','Killa Abdullah','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Chagai','Chagai','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Loralai','Loralai','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Musakhel','Musakhel','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('KillaSaif','Killa Saifullah','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Zhob','Zhob','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Sibi','Sibi','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Ziarat','Ziarat','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Kohlu','Kohlu','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('DeraBugti','Dera Bugti','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Jaffarabad','Jaffarabad','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Nasirabad','Nasirabad','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Bolan','Bolan','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Kachhi','Kachhi','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Kalat','Kalat','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Mastung','Mastung','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Khuzdar','Khuzdar','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Awaran','Awaran','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Kharan','Kharan','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Lasbela','Lasbela','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Kech','Kech','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Gwadar','Gwadar','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Panjgur','Panjgur','Y','PK','Balochstan');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Bajaur','Bajaur','Y','PK','FATA');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Mohmand','Mohmand','Y','PK','FATA');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Khyber','Khyber','Y','PK','FATA');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Kurram','Kurram','Y','PK','FATA');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('Orakzai','Orakzai','Y','PK','FATA');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('SouthWazi','South Waziristan','Y','PK','FATA');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_counties')." (`code`,`name`,`enabled`,`countrycode`,`statecode`) VALUES ('NorthWazi','North Waziristan','Y','PK','FATA');";
	
	return $sql;
}

function getDefaultPakCitiesSQL() {
	$db = &JFactory::getDBO();

	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Chitral','Chitral','Y','PK','NWFP','Chitral');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Dir','Dir','Y','PK','NWFP','UpperDir');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Kohistan','Kohistan','Y','PK','NWFP','UpperDir');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Swat','Swat','Y','PK','NWFP','Swat');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Peshawar','Peshawar','Y','PK','NWFP','Peshawar');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Nowshera','Nowshera','Y','PK','NWFP','Nowshera');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Kohat','Kohat','Y','PK','NWFP','Kohat');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Hangu','Hangu','Y','PK','NWFP','Hangu');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Karak','Karak','Y','PK','NWFP','Karak');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Hassanabda','Hassanabdal','Y','PK','Punjab','Attock');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('FatehJang','Fateh Jang','Y','PK','Punjab','Attock');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('PindiGheb','Pindi Gheb','Y','PK','Punjab','Attock');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Rawalpindi','Rawalpindi','Y','PK','Punjab','Rawalpindi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Taxila','Taxila','Y','PK','Punjab','Rawalpindi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Kahuta','Kahuta','Y','PK','Punjab','Rawalpindi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Murree','Murree','Y','PK','Punjab','Rawalpindi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('GujarKhan','Gujar Khan','Y','PK','Punjab','Rawalpindi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Jhelum','Jhelum','Y','PK','Punjab','Jhelum');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Sohawa','Sohawa','Y','PK','Punjab','Jhelum');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('PindDadan','Pind Dadan Khan','Y','PK','Punjab','Jhelum');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Dina','Dina','Y','PK','Punjab','Jhelum');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Chakwal','Chakwal','Y','PK','Punjab','Chakwal');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Talagang','Talagang','Y','PK','Punjab','Chakwal');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Sargodha','Sargodha','Y','PK','Punjab','Sargodha');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Bhalwal','Bhalwal','Y','PK','Punjab','Sargodha');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('KotMomin','Kot Momin','Y','PK','Punjab','Sargodha');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Bhakkar','Bhakkar','Y','PK','Punjab','Bhakkar');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Khushab','Khushab','Y','PK','Punjab','Khushab');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Faisalabad','Faisalabad City','Y','PK','Punjab','Faisalabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Faisalabad','Faisalabad Saddar','Y','PK','Punjab','Faisalabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Sammundri','Sammundri','Y','PK','Punjab','Faisalabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Jaranwala','Jaranwala','Y','PK','Punjab','Faisalabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Tandlianwa','Tandlianwala','Y','PK','Punjab','Faisalabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Chiniot','Chiniot','Y','PK','Punjab','Jhang');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Jhang','Jhang','Y','PK','Punjab','Jhang');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('TobaTekS','Toba Tek Singh','Y','PK','Punjab','TTSingh');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Gojra','Gojra','Y','PK','Punjab','TTSingh');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Wazirabad','Wazirabad','Y','PK','Punjab','Gujranwala');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Gujranwalacity','Gujranwala City','Y','PK','Punjab','Gujranwala');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Gujranwalasaddar','Gujranwala Saddar','Y','PK','Punjab','Gujranwala');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('NowsheraVirkan','Nowshera Virkan','Y','PK','Punjab','Gujranwala');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Kamoki','Kamoki','Y','PK','Punjab','Gujranwala');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Hafizabad','Hafizabad','Y','PK','Punjab','Hafizabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Gujrat','Gujrat','Y','PK','Punjab','Gujrat');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Kharian','Kharian','Y','PK','Punjab','Gujrat');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('MandiBaha','Mandi Bahauddin','Y','PK','Punjab','MandiBaha');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Sialkot','Sialkot','Y','PK','Punjab','Sialkot');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Narowal','Narowal','Y','PK','Punjab','Narowal');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('LahoreCity','Lahore City','Y','PK','Punjab','Lahore');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Lahore Cantt','Lahore Cantt.','Y','PK','Punjab','Lahore');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Kasur','Kasur','Y','PK','Punjab','Kasur');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Okara','Okara','Y','PK','Punjab','Okara');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('NankanaSa','Nankana Sahib','Y','PK','Punjab','Sheikhupur');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Sheikhupur','Sheikhupura','Y','PK','Punjab','Sheikhupur');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Vehari','Vehari','Y','PK','Punjab','Vehari');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Burewala','Burewala','Y','PK','Punjab','Vehari');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Sahiwal','Sahiwal','Y','PK','Punjab','Sahiwal');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('MultanCit','Multan City','Y','PK','Punjab','Multan');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('MultanSad','Multan Saddar','Y','PK','Punjab','Multan');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('DGKhan','Dera Ghazi Khan','Y','PK','Punjab','DGKhan');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Taunsa','Taunsa','Y','PK','Punjab','DGKhan');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Rajanpur','Rajanpur','Y','PK','Punjab','Rajanpur');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Muzaffarga','Muzaffargarh','Y','PK','Punjab','Muzaffarga');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Bahawalpur','Bahawalpur','Y','PK','Punjab','Hasilpur');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Bahawalnag','Bahawalnagar','Y','PK','Punjab','Bahawalnag');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Liaquatpur','Liaquatpur','Y','PK','Punjab','RYKhan');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Sadiqabad','Sadiqabad','Y','PK','Punjab','RYKhan');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Attock','Attock','Y','PK','Punjab','Attock');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Islamabad','Islamabad City','Y','PK','Capital','Islamabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Jacobabad','Jacobabad','Y','PK','Sind','Jacobabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Thul','Thul','Y','PK','Sind','Jacobabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Kashmor','Kashmor','Y','PK','Sind','Jacobabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Shikarpur','Shikarpur','Y','PK','Sind','Shikarpur');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Shahdadkot','Shahdadkot','Y','PK','Sind','Larkana');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Larkana','Larkana','Y','PK','Sind','Larkana');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Sukkur','Sukkur','Y','PK','Sind','Sukkur');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Ghotki','Ghotki','Y','PK','Sind','Ghotki');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Khairpur','Khairpur','Y','PK','Sind','Khairpur');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Naushahro','Naushahro Feroze','Y','PK','Sind','Naushahro');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('NawabShah','Nawab Shah','Y','PK','Sind','NawabShah');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Dadu','Dadu','Y','PK','Sind','Dadu');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Johi','Johi','Y','PK','Sind','Dadu');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('TandoAlla','Tando Allahyar','Y','PK','Sind','Hyderabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Hyderabad','Hyderabad City','Y','PK','Sind','Hyderabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Latifabad','Latifabad','Y','PK','Sind','Hyderabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Hyderabad','Hyderabad','Y','PK','Sind','Hyderabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Qasimabad','Qasimabad','Y','PK','Sind','Hyderabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('TandoMoha','Tando Mohammad Khan','Y','PK','Sind','Hyderabad');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Golarchi','Golarchi','Y','PK','Sind','Badin');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Badin','Badin','Y','PK','Sind','Badin');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Thatta','Thatta','Y','PK','Sind','Thatta');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('TandoAdam','Tando Adam','Y','PK','Sind','Sanghar');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('MirpurKha','Mirpur Khas','Y','PK','Sind','MirpurKha');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('EntireEa','Entire  East','Y','PK','Sind','Karachi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('KarachiWest','Karachi West','Y','PK','Sind','Karachi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('KarachiSouth','Karachi South','Y','PK','Sind','Karachi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('EntireUrban','Entire Urban','Y','PK','Sind','Karachi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('KarachiCental','Karachi Central','Y','PK','Sind','Karachi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Mali','Mali','Y','PK','Sind','Karachi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Quetta','Quetta','Y','PK','Balochstan','Quetta');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Panjpai','Panjpai','Y','PK','Balochstan','Quetta');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Pishin','Pishin','Y','PK','Balochstan','Pishin');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('KillaAbdu','Killa Abdullah','Y','PK','Balochstan','KillaAbdu');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Nushki','Nushki','Y','PK','Balochstan','Chagai');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Dalbandin','Dalbandin','Y','PK','Balochstan','Chagai');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Chagai','Chagai','Y','PK','Balochstan','Chagai');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Nokundi','Nokundi','Y','PK','Balochstan','Chagai');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Dak','Dak','Y','PK','Balochstan','Chagai');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Taftan','Taftan','Y','PK','Balochstan','Chagai');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('LoralaiBo','Loralai/Bori','Y','PK','Balochstan','Loralai');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Barkhan','Barkhan','Y','PK','Balochstan','Barkhan');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Musakhel','Musakhel','Y','PK','Balochstan','Musakhel');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('KillaSaif','Killa Saifullah','Y','PK','Balochstan','KillaSaif');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Zhob','Zhob','Y','PK','Balochstan','Zhob');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Sibi','Sibi','Y','PK','Balochstan','Sibi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Ziarat','Ziarat','Y','PK','Balochstan','Ziarat');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Kohlu','Kohlu','Y','PK','Balochstan','Kohlu');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('DeraBugti','Dera Bugti','Y','PK','Balochstan','DeraBugti');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Sui','Sui','Y','PK','Balochstan','DeraBugti');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Bhag','Bhag','Y','PK','Balochstan','Bolan');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Balanari','Balanari','Y','PK','Balochstan','Bolan');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Sani','Sani','Y','PK','Balochstan','Bolan');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Mirpur','Mirpur','Y','PK','Balochstan','Kachhi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Kalat','Kalat','Y','PK','Balochstan','Kalat');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Mangochar','Mangochar','Y','PK','Balochstan','Kalat');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Johan','Johan','Y','PK','Balochstan','Kalat');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Dasht','Dasht','Y','PK','Balochstan','Mastung');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('JhalJao','Jhal Jao','Y','PK','Balochstan','Awaran');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Kharan','Kharan','Y','PK','Balochstan','Kharan');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Besima','Besima','Y','PK','Balochstan','Kharan');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Hub','Hub','Y','PK','Balochstan','Lasbela');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Kech','Kech','Y','PK','Balochstan','Kech');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Hoshab','Hoshab','Y','PK','Balochstan','Kech');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Gwadar','Gwadar','Y','PK','Balochstan','Gwadar');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Pasni','Pasni','Y','PK','Balochstan','Gwadar');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Gichk','Gichk','Y','PK','Balochstan','Panjgur');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Bara','Bara','Y','PK','FATA','Khyber');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Jamrud','Jamrud','Y','PK','FATA','Khyber');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('LandiKota','Landi Kotal','Y','PK','FATA','Khyber');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Ladha','Ladha','Y','PK','FATA','SouthWazi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Sararogha','Sararogha','Y','PK','FATA','SouthWazi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Wana','Wana','Y','PK','FATA','SouthWazi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('DattaKhel','Datta Khel','Y','PK','FATA','NorthWazi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Dossali','Dossali','Y','PK','FATA','NorthWazi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Garyum','Garyum','Y','PK','FATA','NorthWazi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('GhulamKha','Ghulam Khan','Y','PK','FATA','NorthWazi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('MirAli','Mir Ali','Y','PK','FATA','NorthWazi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('MiranShah','Miran Shah','Y','PK','FATA','NorthWazi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Razmak','Razmak','Y','PK','FATA','NorthWazi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Spinwam','Spinwam','Y','PK','FATA','NorthWazi');";
        $sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_cities')." (`code`,`name`,`enabled`,`countrycode`,`statecode`,`countycode`) VALUES ('Shewa','Shewa','Y','PK','FATA','NorthWazi');";
	
	return $sql;
}

function getDefaultFieldOrderingSQL() {//change
	$db = &JFactory::getDBO();
	$sql = "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('1', 'jobcategory', 'Job Category', '2', null, '1', '1', '1', '1', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('2', 'name', 'Name', '1', null, '1', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('3', 'url', 'URL', '3', null, '1', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('4', 'contactname', 'Contact Name', '4', null, '1', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('5', 'contactphone', 'Contact Phone', '5', null, '1', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('6', 'contactemail', 'Contact Email', '6', null, '1', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('7', 'since', 'Since', '8', null, '1', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('8', 'companysize', 'Company Size', '9', null, '1', '0', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('9', 'income', 'Income', '10', null, '1', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('10', 'description', 'Description', '11', null, '1', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('11', 'address1', 'Address1', '17', null, '1', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('12', 'logo', 'Logo', '19', null, '1', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('20', 'contactfax', 'Contact Fax', '7', null, '1', '0', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('21', 'country', 'Country', '12', null, '1', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('22', 'state', 'State', '13', null, '1', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('23', 'county', 'County', '14', '', '1', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('24', 'city', 'City', '15', null, '1', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('25', 'zipcode', 'Zipcode', '16', null, '1', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('26', 'address2', 'Address2', '18', null, '1', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('101', 'jobtitle', 'Job Title', '1', null, '2', '1', '1', '1', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('102', 'company', 'Company', '2', null, '2', '1', '1', '1', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('103', 'department', 'Department', '3', null, '2', '1', '1', '0', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('104', 'jobcategory', 'Job Category', '4', null, '2', '1', '1', '1', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('105', 'subcategory', 'Sub Category', '5', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('106', 'jobtype', 'Job Type', '6', null, '2', '1', '1', '1', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('107', 'jobstatus', 'Job Status', '7', null, '2', '1', '1', '1', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('108', 'gender', 'Gender', '8', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('109', 'age', 'Age', '9', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('110', 'jobsalaryrange', 'Job Salary Range', '10', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('111', 'jobshift', 'Job Shift', '11', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('112', 'heighesteducation', 'Heighest Education', '12', null, '2', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('113', 'experience', 'Experience', '13', null, '2', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('114', 'noofjobs', 'No of Jobs', '14', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('115', 'duration', 'Duration', '15', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('116', 'careerlevel', 'Career Level', '16', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('117', 'workpermit', 'Work Permit', '17', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('118', 'requiredtravel', 'Required Travel', '18', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('119', 'video', 'Video', '19', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('120', 'map', 'Map', '20', null, '2', '1', '1', '0', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('121', 'startpublishing', 'Start Publishing', '21', null, '2', '1', '1', '1', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('122', 'stoppublishing', 'Stop Publishing', '22', null, '2', '1', '1', '1', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('123', 'country', 'Country', '23', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('124', 'state', 'State', '24', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('125', 'county', 'County', '25', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('126', 'city', 'City', '26', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('130', 'sendemail', 'Send Email', '27', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('131', 'sendmeresume', 'Send me Resume', '28', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('132', 'description', 'Description', '29', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('133', 'qualifications', 'Qualifications', '30', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('134', 'prefferdskills', 'Prefered Skills', '31', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('135', 'agreement', 'Agreement', '32', null, '2', '1', '1', '0', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('136', 'metadescription', 'Meta Description', '33', null, '2', '1', '1', '0', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('137', 'metakeywords', 'Meta Keywords', '34', null, '2', '1', '1', '0', '1');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('127', 'zipcode', 'Zipcode', '26', null, '2', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('301', 'section_personal', 'Personal Information', '0', '10', '3', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('302', 'applicationtitle', 'Application Title', '1', '10', '3', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('303', 'firstname', 'First Name', '2', '10', '3', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('304', 'middlename', 'Middle Name', '3', '10', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('305', 'lastname', 'Last Name', '4', '10', '3', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('306', 'emailaddress', 'Email Address', '5', '10', '3', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('307', 'homephone', 'Home Phone', '6', '10', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('308', 'workphone', 'Work Phone', '7', '10', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('309', 'cell', 'Cell', '8', '10', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('310', 'nationality', 'Nationality', '9', '10', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('311', 'gender', 'Gender', '10', '10', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('312', 'photo', 'Photo', '12', '10', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('453', 'fileupload', 'File Upload', '13', '10', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('313', 'section_basic', 'Basic Information', '14', '20', '3', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('314', 'category', 'Category', '15', '20', '3', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('315', 'salary', 'Salary ', '16', '20', '3', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('316', 'jobtype', 'Job Type', '17', '20', '3', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('317', 'heighesteducation', 'Heighest Education', '18', '20', '3', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('318', 'totalexperience', 'Total Experience', '19', '20', '3', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('319', 'startdate', 'Date you can start', '20', '20', '3', '1', '1', '1', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('320', 'section_addresses', 'Addresses', '41', '30', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('321', 'section_sub_address', 'Current Address', '42', '31', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('322', 'address_country', 'Country', '43', '31', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('323', 'address_state', 'State', '44', '31', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('324', 'address_county', 'County', '45', '31', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('325', 'address_city', 'City', '46', '31', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('326', 'address_zipcode', 'Zip Code', '47', '31', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('327', 'address_address', 'Address', '48', '31', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('328', 'section_sub_address1', 'Address1', '50', '32', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('329', 'address1_country', 'Country', '51', '32', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('330', 'address1_state', 'State', '52', '32', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('331', 'address1_county', 'County', '53', '32', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('332', 'address1_city', 'City', '54', '32', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('333', 'address1_zipcode', 'Zip Code', '55', '32', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('334', 'address1_address', 'Address', '56', '32', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('335', 'section_sub_address2', 'Address1', '60', '33', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('336', 'address2_country', 'Country', '61', '33', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('337', 'address2_state', 'State', '62', '33', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('338', 'address2_county', 'County', '63', '33', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('339', 'address2_city', 'City', '64', '33', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('340', 'address2_zipcode', 'Zip Code', '65', '33', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('341', 'address2_address', 'Address', '66', '33', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('342', 'section_education', 'Education', '70', '40', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('343', 'section_sub_institute', 'High School', '71', '41', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('344', 'institute_institute', 'Institute', '72', '41', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('345', 'institute_country', 'Country', '73', '41', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('346', 'institute_state', 'State', '74', '41', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('347', 'institute_county', 'County', '75', '41', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('348', 'institute_city', 'City', '76', '41', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('349', 'institute_address', 'Address', '77', '41', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('350', 'institute_certificate', 'Certificate Name', '78', '41', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('351', 'institute_study_area', 'Study Area', '79', '41', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('352', 'section_sub_institute1', 'University', '81', '42', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('353', 'institute1_institute', 'Institute', '82', '42', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('354', 'institute1_country', 'Country', '83', '42', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('355', 'institute1_state', 'State', '84', '42', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('356', 'institute1_county', 'County', '85', '42', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('357', 'institute1_city', 'City', '86', '42', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('358', 'institute1_address', 'Address', '87', '42', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('359', 'institute1_certificate', 'Certificate Name', '88', '42', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('360', 'institute1_study_area', 'Study Area', '89', '42', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('361', 'section_sub_institute2', 'Grade School', '91', '43', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('362', 'institute2_institute', 'Institute', '92', '43', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('363', 'institute2_country', 'Country', '93', '43', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('364', 'institute2_state', 'State', '94', '43', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('365', 'institute2_county', 'County', '95', '43', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('366', 'institute2_city', 'City', '96', '43', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('367', 'institute2_address', 'Address', '97', '43', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('368', 'institute2_certificate', 'Certificate Name', '98', '43', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('369', 'institute2_study_area', 'Study Area', '99', '43', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('370', 'section_sub_institute3', 'Other School', '101', '44', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('371', 'institute3_institute', 'Institute', '102', '44', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('372', 'institute3_country', 'Country', '103', '44', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('373', 'institute3_state', 'State', '104', '44', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('374', 'institute3_county', 'County', '105', '44', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('375', 'institute3_city', 'City', '106', '44', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('376', 'institute3_address', 'Address', '107', '44', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('377', 'institute3_certificate', 'Certificate Name', '108', '44', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('378', 'institute3_study_area', 'Study Area', '109', '44', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('379', 'section_employer', 'Employer', '111', '50', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('380', 'section_sub_employer', 'Recent Employer', '112', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('381', 'employer_employer', 'Employer', '113', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('382', 'employer_position', 'Position', '113', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('383', 'employer_resp', 'Responsibilities', '114', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('384', 'employer_pay_upon_leaving', 'Pay Upon Leaving', '115', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('385', 'employer_supervisor', 'Supervisor', '116', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('386', 'employer_from_date', 'From Date', '117', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('387', 'employer_to_date', 'To Date', '118', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('388', 'employer_leave_reason', 'Leave Reason', '119', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('389', 'employer_country', 'Country', '120', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('390', 'employer_state', 'State', '121', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('391', 'employer_county', 'County', '122', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('392', 'employer_city', 'City', '123', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('393', 'employer_zip', 'Zip Code', '124', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('394', 'employer_phone', 'Phone', '125', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('395', 'employer_address', 'Address', '126', '51', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('396', 'section_sub_employer1', 'Prior Employer 1', '127', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('397', 'employer1_employer', 'Employer', '128', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('398', 'employer1_position', 'Position', '129', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('399', 'employer1_resp', 'Responsibilities', '130', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('400', 'employer1_pay_upon_leaving', 'Pay Upon Leaving', '131', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('401', 'employer1_supervisor', 'Supervisor', '132', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('402', 'employer1_from_date', 'From Date', '133', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('403', 'employer1_to_date', 'To Date', '134', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('404', 'employer1_leave_reason', 'Leave Reason', '135', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('405', 'employer1_country', 'Country', '136', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('406', 'employer1_state', 'State', '137', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('407', 'employer1_county', 'County', '138', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('408', 'employer1_city', 'City', '139', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('409', 'employer1_zip', 'Zip Code', '140', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('410', 'employer1_phone', 'Phone', '141', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('412', 'employer1_address', 'Address', '142', '52', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('413', 'section_sub_employer2', 'Prior Employer 2', '145', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('414', 'employer2_employer', 'Employer', '146', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('415', 'employer2_position', 'Position', '147', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('416', 'employer2_resp', 'Responsibilities', '148', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('417', 'employer2_pay_upon_leaving', 'Pay Upon Leaving', '149', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('418', 'employer2_supervisor', 'Supervisor', '150', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('419', 'employer2_from_date', 'From Date', '151', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('420', 'employer2_to_date', 'To Date', '152', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('421', 'employer2_leave_reason', 'Leave Reason', '153', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('423', 'employer2_country', 'Country', '154', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('424', 'employer2_state', 'State', '155', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('425', 'employer2_county', 'County', '156', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('426', 'employer2_city', 'City', '157', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('427', 'employer2_zip', 'Zip Code', '158', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('428', 'employer2_phone', 'Phone', '159', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('429', 'employer2_address', 'Address', '160', '53', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('430', 'section_sub_employer3', 'Prior Employer 3', '165', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('431', 'employer3_employer', 'Employer', '166', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('432', 'employer3_position', 'Position', '167', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('433', 'employer3_resp', 'Responsibilities', '168', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('434', 'employer3_pay_upon_leaving', 'Pay Upon Leaving', '169', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('435', 'employer3_supervisor', 'Supervisor', '170', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('436', 'employer3_from_date', 'From Date', '171', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('437', 'employer3_to_date', 'To Date', '172', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('438', 'employer3_leave_reason', 'Leave Reason', '173', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('439', 'employer3_country', 'Country', '174', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('440', 'employer3_state', 'State', '175', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('441', 'employer3_county', 'County', '176', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('442', 'employer3_city', 'City', '177', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('443', 'employer3_zip', 'Zip Code', '178', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('444', 'employer3_phone', 'Phone', '179', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('445', 'employer3_address', 'Address', '180', '54', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('446', 'section_skills', 'Skills', '185', '60', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('447', 'driving_license', 'Driving License', '186', '60', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('448', 'license_no', 'License No', '187', '60', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('449', 'license_country', 'License Country', '188', '60', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('450', 'skills', 'Skills', '189', '60', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('451', 'section_resumeeditor', 'Resume Editor', '195', '70', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('452', 'editor', 'Editor', '196', '70', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('454', 'section_references', 'References', '205', '80', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('455', 'section_sub_reference', 'Reference 1', '206', '81', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('456', 'reference_reference', 'Reference', '207', '81', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('457', 'reference_name', 'Name', '208', '81', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('458', 'reference_country', 'Country', '209', '81', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('459', 'reference_state', 'State', '210', '81', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('460', 'reference_county', 'County', '211', '81', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('471', 'reference_city', 'City', '212', '81', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('472', 'reference_zipcode', 'Zip Code', '213', '81', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('473', 'reference_phone', 'Phone', '214', '81', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('474', 'reference_relation', 'Relation', '215', '81', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('475', 'reference_years', 'Years', '216', '81', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('476', 'section_sub_reference1', 'Reference 2', '220', '82', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('477', 'reference1_reference', 'Reference', '221', '82', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('478', 'reference1_name', 'Name', '222', '82', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('479', 'reference1_country', 'Country', '223', '82', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('480', 'reference1_state', 'State', '224', '82', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('481', 'reference1_county', 'County', '225', '82', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('482', 'reference1_city', 'City', '226', '82', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('483', 'reference1_zipcode', 'Zip Code', '227', '82', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('484', 'reference1_phone', 'Phone', '228', '82', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('485', 'reference1_relation', 'Relation', '229', '82', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('486', 'reference1_years', 'Years', '230', '82', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('487', 'section_sub_reference2', 'Reference 3', '231', '83', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('488', 'reference2_reference', 'Reference', '232', '83', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('489', 'reference2_name', 'Name', '233', '83', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('490', 'reference2_country', 'Country', '234', '83', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('491', 'reference2_state', 'State', '235', '83', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('492', 'reference2_county', 'County', '236', '83', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('493', 'reference2_city', 'City', '237', '83', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('494', 'reference2_zipcode', 'Zip Code', '238', '83', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('495', 'reference2_phone', 'Phone', '239', '83', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('496', 'reference2_relation', 'Relation', '240', '83', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('497', 'reference2_years', 'Years', '241', '83', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('498', 'section_sub_reference3', 'Reference 4', '242', '84', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('499', 'reference3_reference', 'Reference', '243', '84', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('500', 'reference3_name', 'Name', '244', '84', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('501', 'reference3_country', 'Country', '245', '84', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('502', 'reference3_state', 'State', '246', '84', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('503', 'reference3_county', 'County', '247', '84', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('504', 'reference3_city', 'City', '248', '84', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('505', 'reference3_zipcode', 'Zip Code', '249', '84', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('506', 'reference3_phone', 'Phone', '250', '84', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('507', 'reference3_relation', 'Relation', '251', '84', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('508', 'reference3_years', 'Years', '252', '84', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('510', 'Iamavailable', 'I am Available', '11', '10', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO ".$db->nameQuote('#__wrecruit_fieldsordering')." VALUES ('511', 'searchable', 'Searchable', '12', '10', '3', '1', '1', '0', '0');";
	$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'section_userfields', 'User Fields', '21', '1000', '3', '0', '0', '0', '0');";
	$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield1', 'User Field 1', '22', '1000', '3', '0', '0', '0', '0');";
	$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield2', 'User Field 2', '23', '1000', '3', '0', '0', '0', '0');";
	$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield3', 'User Field 3', '24', '1000', '3', '0', '0', '0', '0');";
	$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield4', 'User Field 4', '25', '1000', '3', '0', '0', '0', '0');";
	$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield5', 'User Field 5', '26', '1000', '3', '0', '0', '0', '0');";
	$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield6', 'User Field 6', '27', '1000', '3', '0', '0', '0', '0');";
	$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield7', 'User Field 7', '28', '1000', '3', '0', '0', '0', '0');";
	$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield8', 'User Field 8', '29', '1000', '3', '0', '0', '0', '0');";
	$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield9', 'User Field 9', '30', '1000', '3', '0', '0', '0', '0');";
	$sql .= "INSERT INTO  ".$db->nameQuote('#__wrecruit_fieldsordering')." (`field`, `fieldtitle`, `ordering`,`section`,`fieldfor`,`published`,`sys`,`cannotunpublish`,`required`) VALUES ( 'userfield10', 'User Field 10', '31', '1000', '3', '0', '0', '0', '0');";
	return $sql;
}

	function installModulePlugin($version) {
		
		jimport('joomla.installer.helper');
		$installer = new JInstaller();
		
		$installmp = 1;
		
		$version = new JVersion;
		$joomla = $version->getShortVersion();
		$jversion = substr($joomla,0,3);
		if($version != 0){ // update case
			if($jversion == '1.5') $installmp = 0;
		}
		if($installmp == 1){
			$ext_module_path = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_wrecruit'.DS.'extensions'.DS.'modules'.DS;
			$extensions = array( 'featuredcompanies.zip'=>'Featured Companies Module',
				'featuredjobs.zip'=>'Featured Jobs Module',
				'featuredresumes.zip'=>'Featured Resumes Module',
				'goldcompanies.zip'=>'Gold Companies Module',
				'goldjobs.zip'=>'Gold Jobs Module',
				'goldresumes.zip'=>'Gold Resumes Module',
				'hotwrecruit.zip'=>'Hot Jobs Module',
				'wrecruitsearch.zip'=>'Jobs Search Module',
				'jsresumesearch.zip'=>'Resume Search Module',
				'jstopresume.zip'=>'Top Resume Module',
				'mod_jsjobcategories.zip'=>'Job Categories Module',
				'mod_wrecruitcity.zip'=>'Jobs City Module',
				'mod_wrecruitcountry.zip'=>'Jobs Country Module',
				'mod_wrecruitlogin.zip'=>'WRecruit Login Module',
				'mod_wrecruitstats.zip'=>'WRecruit Stats Module',
				'newestwrecruit.zip'=>'Newest Jobs Module',
				'newestjsresume.zip'=>'Newest Resume Module',
				'topwrecruit.zip'=>'Top Jobs Module'

			 );
			   
				 
			 foreach( $extensions as $ext => $extname ){
				  $package = JInstallerHelper::unpack( $ext_module_path.$ext );
				  if( $installer->install( $package['dir'] ) ){
					$msgcolor = "#E0FFE0";
					$msgtext  = "$extname successfully installed.";
				  }else{
					$msgcolor = "#FFD0D0";
					$msgtext  = "ERROR: Could not install the $extname. Please install manually.";
				  }
				  ?>
				  <table bgcolor="<?php echo $msgcolor; ?>" width ="100%">
					<tr style="height:25px">
					  <td width="50px"><img src="/administrator/images/tick.png" height="20px" width="20px"></td>
					  <td><font size="2"><b><?php echo $msgtext; ?></b></font></td>
					</tr>
				  </table>
				<?php
				JInstallerHelper::cleanupInstall( $ext_module_path.$ext, $package['dir'] ); 
			}

			$ext_plugin_path = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_wrecruit'.DS.'extensions'.DS.'plugins'.DS;
			$extensions = array( 'plg_jsfeaturedcompanies.zip'=>'Featured Companies Plugin',
				'plg_jsfeaturedjobs.zip'=>'Featured Jobs Plugin',
				'plg_jsfeaturedresumes.zip'=>'Featured Resumes Plugin',
				'plg_jsgoldcompanies.zip'=>'Gold Companies Plugin',
				'plg_jsgoldjobs.zip'=>'Gold Jobs Plugin',
				'plg_jsgoldresumes.zip'=>'Gold Resumes Plugin',
				'plg_jshotjobs.zip'=>'Hot Jobs Plugin',
				'plg_jssearchjobs.zip'=>'Jobs Search Plugin',
				'plg_jssearchresumes.zip'=>'Resume Search Plugin',
				'plg_jstopresume.zip'=>'Top Resume Plugin',
				'plg_jsjobcategories.zip'=>'Job Categories Plugin',
				'plg_wrecruitcity.zip'=>'Jobs City Plugin',
				'plg_wrecruitcountries.zip'=>'Jobs Country Plugin',
				'plg_wrecruitregister.zip'=>'WRecruit plg_wrecruitregister Plugin',
				'plg_wrecruitstates.zip'=>'WRecruit Stats Plugin',
				'plg_jsnewestjobs.zip'=>'Newest Jobs Plugin',
				'plg_jsnewestresume.zip'=>'Newest Resume Plugin',
				'plg_jstopjobs.zip'=>'Top Jobs Plugin'

			 );
			   
				 
			 foreach( $extensions as $ext => $extname ){
				  $package = JInstallerHelper::unpack( $ext_plugin_path.$ext );
				  if( $installer->install( $package['dir'] ) ){
					$msgcolor = "#E0FFE0";
					$msgtext  = "$extname successfully installed.";
				  }else{
					$msgcolor = "#FFD0D0";
					$msgtext  = "ERROR: Could not install the $extname. Please install manually.";
				  }
				  ?>
				  <table bgcolor="<?php echo $msgcolor; ?>" width ="100%">
					<tr style="height:25px">
					  <td width="50px"><img src="/administrator/images/tick.png" height="20px" width="20px"></td>
					  <td><font size="2"><b><?php echo $msgtext; ?></b></font></td>
					</tr>
				  </table>
				<?php
				JInstallerHelper::cleanupInstall( $ext_plugin_path.$ext, $package['dir'] ); 
			}
		}

	}

?>
